mercurial/bundlerepo.py
changeset 45814 88d5abec8f61
parent 43564 698e11f7be6a
child 45942 89a2afe31e82
--- a/mercurial/bundlerepo.py	Tue Oct 20 15:09:08 2020 +0200
+++ b/mercurial/bundlerepo.py	Wed Oct 07 03:00:01 2020 +0200
@@ -63,11 +63,14 @@
             size = len(delta)
             start = cgunpacker.tell() - size
 
-            link = linkmapper(cs)
             if self.index.has_node(node):
                 # this can happen if two branches make the same change
                 self.bundlerevs.add(self.index.rev(node))
                 continue
+            if cs == node:
+                linkrev = nullrev
+            else:
+                linkrev = linkmapper(cs)
 
             for p in (p1, p2):
                 if not self.index.has_node(p):
@@ -87,7 +90,7 @@
                 size,
                 -1,
                 baserev,
-                link,
+                linkrev,
                 self.rev(p1),
                 self.rev(p2),
                 node,