/// <summary>
/// Gets the root directory of the repository, derived from the current directory and svn info
/// </summary>
/// <returns></returns>
public string GetLocalRootDirectory()
{
Regex urlRegEx = new Regex(@"^(\s)*URL(\s)*:(\s)*(?<url>(\S)*)(\s)*$",
RegexOptions.ExplicitCapture);
ProcessReader procReader = new ProcessReader(LogOptions.None);
string svnInfo = procReader.RunExecutable(ClientExe, false, "info");
string url = null;
if (svnInfo != null)
{
StringReader sr = new StringReader(svnInfo);
while (url == null)
{
string l = sr.ReadLine();
if (l == null)
break;
Match urlMatch = urlRegEx.Match(l);
if (urlMatch.Success)
{
url = urlMatch.Groups[1].Value;
}
}
}
// the client is unused in Subversion, so generate our from the computer name
return GetLocalRootDirectory(url);
}