D4190: changegroup: track changelog to manifest revision map explicitly

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu Aug 9 16:27:29 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG40374b4a780f: changegroup: track changelog to manifest revision map explicitly (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4190?vs=10157&id=10179

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

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -661,14 +661,10 @@
         # Maps CL revs to per-revlog revisions. Cleared in close() at
         # the end of each group.
         self._clrevtolocalrev = {}
-        self._nextclrevtolocalrev = {}
 
     def _close(self):
         # Ellipses serving mode.
         self._clrevtolocalrev.clear()
-        if self._nextclrevtolocalrev is not None:
-            self._clrevtolocalrev = self._nextclrevtolocalrev
-            self._nextclrevtolocalrev = None
 
         return closechunk()
 
@@ -784,6 +780,9 @@
         mfs = clstate['mfs']
         changedfiles = clstate['changedfiles']
 
+        if self._ellipses:
+            self._clrevtolocalrev = clstate['clrevtomanifestrev']
+
         # We need to make sure that the linkrev in the changegroup refers to
         # the first changeset that introduced the manifest or file revision.
         # The fastpath is usually safer than the slowpath, because the filelogs
@@ -853,6 +852,7 @@
         # TODO violates storage abstraction.
         mfrevlog = mfl._revlog
         changedfiles = set()
+        clrevtomanifestrev = {}
 
         # Callback for the changelog, used to collect changed files and
         # manifest nodes.
@@ -876,8 +876,7 @@
                     # manifest revnum to look up for this cl revnum. (Part of
                     # mapping changelog ellipsis parents to manifest ellipsis
                     # parents)
-                    self._nextclrevtolocalrev.setdefault(cl.rev(x),
-                                                         mfrevlog.rev(n))
+                    clrevtomanifestrev.setdefault(cl.rev(x), mfrevlog.rev(n))
                 # We can't trust the changed files list in the changeset if the
                 # client requested a shallow clone.
                 if self._isshallow:
@@ -903,6 +902,7 @@
             'clrevorder': clrevorder,
             'mfs': mfs,
             'changedfiles': changedfiles,
+            'clrevtomanifestrev': clrevtomanifestrev,
         }
 
         gen = self.group(revs, cl, True, lookupcl, units=_('changesets'))



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list