diff mercurial/bundle2.py @ 45117:b1e51ef4e536

phases: sparsify phase lists When the internal and archived phase was added, allphase became a large, sparsely populated list. This dramatically increased the number of lookup operations for public relations in `phasecache.phase`. As a first step, define allphases and related lists explicitly to contain only the actual phases. Make phasenames a dictionary and create corresponding dictionaries for mapping phase names back to numbers. Adjust various list to be sparse as well with the exception of phaseroots and phasesets members of phasecache. Keep those as a separate step as it involves changes to the C module. Differential Revision: https://phab.mercurial-scm.org/D8697
author Joerg Sonnenberger <joerg@bec.de>
date Wed, 08 Jul 2020 00:15:15 +0200
parents a03c177a4679
children c93dd9d9f1e6
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue Jul 07 22:00:02 2020 +0200
+++ b/mercurial/bundle2.py	Wed Jul 08 00:15:15 2020 +0200
@@ -2208,7 +2208,7 @@
         b'remote repository changed while pushing - please try again '
         b'(%s is %s expected %s)'
     )
-    for expectedphase, nodes in enumerate(phasetonodes):
+    for expectedphase, nodes in pycompat.iteritems(phasetonodes):
         for n in nodes:
             actualphase = phasecache.phase(unfi, cl.rev(n))
             if actualphase != expectedphase: