third_party/copybara: patch HgDestination to make new repos non-publishing
This commit is contained in:
parent
32f5d4c104
commit
823fbc91f6
3 changed files with 22 additions and 1 deletions
1
third_party/copybara/copy.bara.sky
vendored
1
third_party/copybara/copy.bara.sky
vendored
|
@ -21,6 +21,7 @@ core.workflow(
|
||||||
patch.apply(patches = [
|
patch.apply(patches = [
|
||||||
"patches/0001-Make-Mercurial-at-least-slightly-usable.patch",
|
"patches/0001-Make-Mercurial-at-least-slightly-usable.patch",
|
||||||
"patches/0002-HgRepository-HGPLAIN.patch",
|
"patches/0002-HgRepository-HGPLAIN.patch",
|
||||||
|
"patches/0003-HgDestination-nonpublishing.patch",
|
||||||
]),
|
]),
|
||||||
core.move("", "third_party/copybara"),
|
core.move("", "third_party/copybara"),
|
||||||
],
|
],
|
||||||
|
|
|
@ -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
|
// 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"),
|
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");
|
console.progress("Hg Destination: Computing diff");
|
||||||
getDiffAndStageChanges(destinationFiles, workdir, localRepo);
|
getDiffAndStageChanges(destinationFiles, workdir, localRepo);
|
||||||
|
|
20
third_party/copybara/patches/0003-HgDestination-nonpublishing.patch
vendored
Normal file
20
third_party/copybara/patches/0003-HgDestination-nonpublishing.patch
vendored
Normal 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);
|
Loading…
Reference in a new issue