diff --git a/third_party/copybara/copy.bara.sky b/third_party/copybara/copy.bara.sky index ea9234c72c..2d543e2496 100644 --- a/third_party/copybara/copy.bara.sky +++ b/third_party/copybara/copy.bara.sky @@ -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"), ], diff --git a/third_party/copybara/java/com/google/copybara/hg/HgDestination.java b/third_party/copybara/java/com/google/copybara/hg/HgDestination.java index b60e49111b..41ca1c83b3 100644 --- a/third_party/copybara/java/com/google/copybara/hg/HgDestination.java +++ b/third_party/copybara/java/com/google/copybara/hg/HgDestination.java @@ -281,7 +281,7 @@ public class HgDestination implements Destination { // 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); diff --git a/third_party/copybara/patches/0003-HgDestination-nonpublishing.patch b/third_party/copybara/patches/0003-HgDestination-nonpublishing.patch new file mode 100644 index 0000000000..504d0b28ff --- /dev/null +++ b/third_party/copybara/patches/0003-HgDestination-nonpublishing.patch @@ -0,0 +1,20 @@ +# HG changeset patch +# User Luke Granger-Brown +# 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);