changelog: keep track of duplicated node in the transaction adding them
authorBoris Feld <boris.feld@octobus.net>
Thu, 20 Sep 2018 11:18:28 +0200
changeset 39887 a3095bc47217
parent 39886 debc4ee597e7
child 39888 42a6b228dd2e
changelog: keep track of duplicated node in the transaction adding them The transaction is already tracking the new nodes. We now tracks the "duplicates" in the same location.
mercurial/changelog.py
--- a/mercurial/changelog.py	Wed Sep 19 21:02:47 2018 +0200
+++ b/mercurial/changelog.py	Thu Sep 20 11:18:28 2018 +0200
@@ -545,3 +545,10 @@
         just to access this is costly."""
         extra = self.read(rev)[5]
         return encoding.tolocal(extra.get("branch")), 'close' in extra
+
+    def _nodeduplicatecallback(self, transaction, node):
+        # keep track of revisions that got "re-added", eg: unbunde of know rev.
+        #
+        # We track them in a list to preserve their order from the source bundle
+        duplicates = transaction.changes.setdefault('revduplicates', [])
+        duplicates.append(self.rev(node))