Skip to content

Commit

Permalink
use HgRunner instead of trying to locate mercurial manually
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Nov 28, 2024
1 parent c3f71aa commit e00fcfc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Chorus.VcsDrivers.Mercurial;
using SIL.CommandLineProcessing;
using SIL.PlatformUtilities;
using SIL.Progress;
Expand All @@ -6,12 +7,11 @@ namespace FwLiteProjectSync.Tests.Fixtures;

public static class MercurialTestHelper
{
public static string HgCommand =>
Path.Combine("Mercurial", Platform.IsWindows ? "hg.exe" : "hg");
private static readonly NullProgress NullProgress = new NullProgress();

private static string RunHgCommand(string repoPath, string args)
{
var result = CommandLineRunner.Run(HgCommand, args, repoPath, 120, new NullProgress());
var result = HgRunner.Run(args, repoPath, 120, NullProgress);
if (result.ExitCode == 0) return result.StandardOutput;
throw new Exception(
$"hg {args} failed.\nStdOut: {result.StandardOutput}\nStdErr: {result.StandardError}");
Expand Down

0 comments on commit e00fcfc

Please sign in to comment.