From 0d3567ea7e924ab364584e14b9517291892e9d0a Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 4 Jul 2021 15:10:44 +0000 Subject: [PATCH] 3p/copybara: disable topic-mode when committing --- third_party/copybara/copy.bara.sky | 1 + .../java/com/google/copybara/hg/HgDestination.java | 2 +- .../copybara/patches/hg-topic-mode-ignore.patch | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 third_party/copybara/patches/hg-topic-mode-ignore.patch diff --git a/third_party/copybara/copy.bara.sky b/third_party/copybara/copy.bara.sky index 4a34d64d6c..a96d6b9b43 100644 --- a/third_party/copybara/copy.bara.sky +++ b/third_party/copybara/copy.bara.sky @@ -23,6 +23,7 @@ core.workflow( "patches/0002-HgRepository-HGPLAIN.patch", "patches/0003-HgDestination-nonpublishing.patch", "patches/diff-support-T.patch", + "patches/hg-topic-mode-ignore.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 86f190cebb..47a604eb33 100644 --- a/third_party/copybara/java/com/google/copybara/hg/HgDestination.java +++ b/third_party/copybara/java/com/google/copybara/hg/HgDestination.java @@ -301,7 +301,7 @@ public class HgDestination implements Destination { ChangeMessage msg = getChangeMessage(transformResult, ORIGIN_LABEL_SEPARATOR); String date = transformResult.getTimestamp().format(DateTimeFormatter.RFC_1123_DATE_TIME); - localRepo.hg(localRepo.getHgDir().getParent(), "commit", "--user", + localRepo.hg(localRepo.getHgDir().getParent(), "commit", "--config", "experimental.topic-mode=ignore", "--user", transformResult.getAuthor().toString(), "--date", date, "-m", msg.toString()); diff --git a/third_party/copybara/patches/hg-topic-mode-ignore.patch b/third_party/copybara/patches/hg-topic-mode-ignore.patch new file mode 100644 index 0000000000..e0d01e7d4d --- /dev/null +++ b/third_party/copybara/patches/hg-topic-mode-ignore.patch @@ -0,0 +1,12 @@ +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 +@@ -301,7 +301,7 @@ public class HgDestination implements De + ChangeMessage msg = getChangeMessage(transformResult, ORIGIN_LABEL_SEPARATOR); + String date = transformResult.getTimestamp().format(DateTimeFormatter.RFC_1123_DATE_TIME); + +- localRepo.hg(localRepo.getHgDir().getParent(), "commit", "--user", ++ localRepo.hg(localRepo.getHgDir().getParent(), "commit", "--config", "experimental.topic-mode=ignore", "--user", + transformResult.getAuthor().toString(), "--date", date, + "-m", msg.toString()); +