depot/third_party/copybara/patches/0002-HgRepository-HGPLAIN.patch

32 lines
1.3 KiB
Diff

# HG changeset patch
# User Luke Granger-Brown <hg@lukegb.com>
# Date 1589670391 -3600
# Sun May 17 00:06:31 2020 +0100
# Node ID ac30ad2187112d227da97d68c1996663fabfa1f6
# Parent 478b958c38cb0d2e354076b55b21232f69af5fcc
third_party/copybara: patch HgRepository to use HGPLAIN
diff --git a/java/com/google/copybara/hg/HgRepository.java b/java/com/google/copybara/hg/HgRepository.java
--- a/java/com/google/copybara/hg/HgRepository.java
+++ b/java/com/google/copybara/hg/HgRepository.java
@@ -51,6 +51,8 @@ import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
import javax.annotation.Nullable;
/**
@@ -240,8 +242,10 @@ public class HgRepository {
List<String> allParams = new ArrayList<>(Iterables.size(params) + 1);
allParams.add("hg"); //TODO(jlliu): resolve Hg binary here
Iterables.addAll(allParams, params);
+ Map<String, String> environment = new HashMap<>();
+ environment.put("HGPLAIN", "");
Command cmd = new Command(
- Iterables.toArray(allParams, String.class), null, cwd.toFile());
+ Iterables.toArray(allParams, String.class), environment, cwd.toFile());
//TODO(jlliu): have environment vars
CommandRunner runner = new CommandRunner(cmd, timeout).withVerbose(verbose);
return