diff mercurial/scmutil.py @ 36091:137a08d82232

transaction: build changes['revs'] as range instead of a set Revisions are added consecutively, so a range can easily represent them in the changes list. This saves around 45 Bytes / revision on 64bit platforms and reduces the memory footprint of issue5691 by 15MB. Don't copy changes['revs'] in getobsoleted. Ranges have a very efficient contains implementation already. Differential Revision: https://phab.mercurial-scm.org/D1615
author Joerg Sonnenberger <joerg@bec.de>
date Fri, 08 Dec 2017 01:23:34 +0100 (2017-12-08)
parents 278f1feee73a
children b1959391a088
line wrap: on
line diff
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1262,7 +1262,7 @@
         @reportsummary
         def reportnewcs(repo, tr):
             """Report the range of new revisions pulled/unbundled."""
-            newrevs = list(tr.changes.get('revs', set()))
+            newrevs = tr.changes.get('revs', xrange(0, 0))
             if not newrevs:
                 return