changeset 8454:6d4bf1c1a003

rebase: use set instead of dict
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 17 May 2009 02:55:22 +0200
parents d1ca637b0773
children a858b54d072b
files hgext/rebase.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Sun May 17 02:44:12 2009 +0200
+++ b/hgext/rebase.py	Sun May 17 02:55:22 2009 +0200
@@ -51,7 +51,8 @@
     """
     originalwd = target = None
     external = nullrev
-    state = skipped = {}
+    state = {}
+    skipped = set()
 
     lock = wlock = None
     try:
@@ -143,7 +144,7 @@
     finally:
         release(lock, wlock)
 
-def concludenode(repo, rev, p1, p2, state, collapse, last=False, skipped={},
+def concludenode(repo, rev, p1, p2, state, collapse, last=False, skipped=None,
                  extrafn=None):
     """Skip commit if collapsing has been required and rev is not the last
     revision, commit otherwise
@@ -155,6 +156,9 @@
 
     repo.dirstate.setparents(repo[p1].node(), repo[p2].node())
 
+    if skipped is None:
+        skipped = set()
+
     # Commit, record the old nodeid
     m, a, r = repo.status()[:3]
     newrev = nullrev
@@ -234,7 +238,7 @@
         if not collapse:
             repo.ui.note(_('no changes, revision %d skipped\n') % rev)
             repo.ui.debug(_('next revision set to %s\n') % p1)
-            skipped[rev] = True
+            skipped.add(rev)
         state[rev] = p1
 
 def defineparents(repo, rev, target, state, targetancestors):