strip: stop calling `remove` on smartset
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 07 Oct 2014 00:38:14 -0700
changeset 22824 9271630f4720
parent 22823 18ac67b0814c
child 22825 0e8bb81b58b9
strip: stop calling `remove` on smartset The `remove` method is not part of the smartset specification. We use a plain old list comprehension instead.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Oct 07 00:31:53 2014 -0700
+++ b/mercurial/commands.py	Tue Oct 07 00:38:14 2014 -0700
@@ -3381,10 +3381,12 @@
             raise util.Abort(_('no revisions specified'))
         revs = scmutil.revrange(repo, revs)
 
+    skipped = set()
     # check for merges
     for rev in repo.revs('%ld and merge()', revs):
         ui.warn(_('skipping ungraftable merge revision %s\n') % rev)
-        revs.remove(rev)
+        skipped.add(rev)
+    revs = [r for r in revs if r not in skipped]
     if not revs:
         return -1