diff mercurial/obsutil.py @ 35308: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
parents b81ad5b78a81
children 265cd9e19d26
line wrap: on
line diff
--- a/mercurial/obsutil.py	Wed Dec 06 16:43:07 2017 -0500
+++ b/mercurial/obsutil.py	Fri Dec 08 01:23:34 2017 +0100
@@ -441,12 +441,12 @@
     public = phases.public
     addedmarkers = tr.changes.get('obsmarkers')
     addedrevs = tr.changes.get('revs')
-    seenrevs = set(addedrevs)
+    seenrevs = set()
     obsoleted = set()
     for mark in addedmarkers:
         node = mark[0]
         rev = torev(node)
-        if rev is None or rev in seenrevs:
+        if rev is None or rev in seenrevs or rev in addedrevs:
             continue
         seenrevs.add(rev)
         if phase(repo, rev) == public: