diff --git a/src/LibChorus/MercurialLocation.cs b/src/LibChorus/MercurialLocation.cs index 3ac61b79..f0f5f5d5 100644 --- a/src/LibChorus/MercurialLocation.cs +++ b/src/LibChorus/MercurialLocation.cs @@ -12,6 +12,7 @@ public class MercurialLocation { private static string _pathToMercurialFolder; + private static string _hgExe = Platform.IsWindows ? "hg.exe" : "hg"; /// /// Clients can set this if they have their own private copy of Mercurial (recommended) @@ -31,7 +32,7 @@ public static string PathToMercurialFolder return; } RequireThat.Directory(value).Exists(); - string expectedHgLocation=Path.Combine(value, Platform.IsWindows ? "hg.exe" : "hg"); + string expectedHgLocation=Path.Combine(value, _hgExe); if (!File.Exists(expectedHgLocation)) { throw new FileNotFoundException(expectedHgLocation); @@ -50,8 +51,8 @@ public static string PathToHgExecutable GuessAtLocationIfNotSetAlready(); if(string.IsNullOrEmpty(_pathToMercurialFolder)) - return "hg"; //rely on the PATH - return Path.Combine(_pathToMercurialFolder, "hg"); + return _hgExe; //rely on the PATH + return Path.Combine(_pathToMercurialFolder, _hgExe); } }