changeset 46510:fa7ae7aa0efd

changegroup: don't convert revisions to node for duplicate handling The only consumer can handle revision lists fine. Avoid materializing a range if there are no duplicates as optimization. Differential Revision: https://phab.mercurial-scm.org/D9884
author Joerg Sonnenberger <joerg@bec.de>
date Wed, 27 Jan 2021 03:07:14 +0100
parents 7a93b7b3dc2d
children 02d91167cfc3
files mercurial/changegroup.py
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Wed Jan 27 02:34:51 2021 +0100
+++ b/mercurial/changegroup.py	Wed Jan 27 03:07:14 2021 +0100
@@ -316,11 +316,11 @@
             self.callback = progress.increment
 
             efilesset = set()
-            cgnodes = []
+            duprevs = []
 
             def ondupchangelog(cl, rev):
                 if rev < clstart:
-                    cgnodes.append(cl.node(rev))
+                    duprevs.append(rev)
 
             def onchangelog(cl, rev):
                 ctx = cl.changelogrevision(rev)
@@ -448,8 +448,12 @@
             if added:
                 phases.registernew(repo, tr, targetphase, added)
             if phaseall is not None:
-                phases.advanceboundary(repo, tr, phaseall, cgnodes, revs=added)
-                cgnodes = []
+                if duprevs:
+                    duprevs.extend(added)
+                else:
+                    duprevs = added
+                phases.advanceboundary(repo, tr, phaseall, [], revs=duprevs)
+                duprevs = []
 
             if changesets > 0: