Patchwork D9160: bundlerepo: don't insert index tuples with full nodes as linkrev

login
register
mail settings
Submitter phabricator
Date Oct. 7, 2020, 1:26 a.m.
Message ID <differential-rev-PHID-DREV-htrcc6faotbkbaynjbuj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47389/
State New
Headers show

Comments

phabricator - Oct. 7, 2020, 1:26 a.m.
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9160

AFFECTED FILES
  mercurial/bundlerepo.py

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -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,