D10995: corruption: backout changeset 49fd21f32695 (issue6528)

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Tue Jul 6 14:40:46 UTC 2021


marmoute created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  inverting the parent is masking copy information leading to bad content being
  fetched and bad status result.
  
  Since 49fd21f32695 <https://phab.mercurial-scm.org/rHG49fd21f32695d885d730b56d91707c9059c6bd54>, exchange can actively swap these parent corrupting existing
  changesets and triggering the corruption.
  
  Data corruption are considered critical so backing this out and doing and
  unscheduled release seems in order.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/revlog.py
  tests/test-narrow-shallow-merges.t

CHANGE DETAILS

diff --git a/tests/test-narrow-shallow-merges.t b/tests/test-narrow-shallow-merges.t
--- a/tests/test-narrow-shallow-merges.t
+++ b/tests/test-narrow-shallow-merges.t
@@ -179,7 +179,7 @@
   
 
   $ hg log -T '{if(ellipsis,"...")}{node|short} {p1node|short} {p2node|short} {desc}\n' | sort
-  ...2a20009de83e 3ac1f5779de3 000000000000 outside 10
+  ...2a20009de83e 000000000000 3ac1f5779de3 outside 10
   ...3ac1f5779de3 bb96a08b062a 465567bdfb2d merge a/b/c/d 9
   ...8d874d57adea 7ef88b4dd4fa 000000000000 outside 12
   ...b844052e7b3b 000000000000 000000000000 outside 2c
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -884,10 +884,8 @@
             if rev == wdirrev:
                 raise error.WdirUnsupported
             raise
-        if entry[5] == nullrev:
-            return entry[6], entry[5]
-        else:
-            return entry[5], entry[6]
+
+        return entry[5], entry[6]
 
     # fast parentrevs(rev) where rev isn't filtered
     _uncheckedparentrevs = parentrevs
@@ -908,11 +906,7 @@
     def parents(self, node):
         i = self.index
         d = i[self.rev(node)]
-        # inline node() to avoid function call overhead
-        if d[5] == nullid:
-            return i[d[6]][7], i[d[5]][7]
-        else:
-            return i[d[5]][7], i[d[6]][7]
+        return i[d[5]][7], i[d[6]][7]  # map revisions to nodes inline
 
     def chainlen(self, rev):
         return self._chaininfo(rev)[0]



To: marmoute, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list