third_party/copybara: patch HgDestination to make new repos non-publishing

This commit is contained in:
Luke Granger-Brown 2020-05-17 00:08:49 +01:00
parent 32f5d4c104
commit 823fbc91f6
3 changed files with 22 additions and 1 deletions

View file

@ -21,6 +21,7 @@ core.workflow(
patch.apply(patches = [
"patches/0001-Make-Mercurial-at-least-slightly-usable.patch",
"patches/0002-HgRepository-HGPLAIN.patch",
"patches/0003-HgDestination-nonpublishing.patch",
]),
core.move("", "third_party/copybara"),
],

View file

@ -281,7 +281,7 @@ public class HgDestination implements Destination<HgRevision> {
// Set the default path of the local repo to be the remote repo, so we can push to it
Files.write(localRepo.getHgDir().getParent().resolve(".hg/hgrc"),
String.format("[paths]\ndefault = %s\n", repoUrl).getBytes(StandardCharsets.UTF_8));
String.format("[paths]\ndefault = %s\n\n[phases]\npublish = False\n", repoUrl).getBytes(StandardCharsets.UTF_8));
console.progress("Hg Destination: Computing diff");
getDiffAndStageChanges(destinationFiles, workdir, localRepo);

View file

@ -0,0 +1,20 @@
# HG changeset patch
# User Luke Granger-Brown <hg@lukegb.com>
# Date 1589670529 -3600
# Sun May 17 00:08:49 2020 +0100
# Node ID 9b758f16a985c3e801e07ea1a6e04f01924ae774
# Parent ac30ad2187112d227da97d68c1996663fabfa1f6
third_party/copybara: patch HgDestination to make new repos non-publishing
diff --git a/java/com/google/copybara/hg/HgDestination.java b/java/com/google/copybara/hg/HgDestination.java
--- a/java/com/google/copybara/hg/HgDestination.java
+++ b/java/com/google/copybara/hg/HgDestination.java
@@ -281,7 +281,7 @@ public class HgDestination implements De
// Set the default path of the local repo to be the remote repo, so we can push to it
Files.write(localRepo.getHgDir().getParent().resolve(".hg/hgrc"),
- String.format("[paths]\ndefault = %s\n", repoUrl).getBytes(StandardCharsets.UTF_8));
+ String.format("[paths]\ndefault = %s\n\n[phases]\npublish = False\n", repoUrl).getBytes(StandardCharsets.UTF_8));
console.progress("Hg Destination: Computing diff");
getDiffAndStageChanges(destinationFiles, workdir, localRepo);