##// END OF EJS Templates
graft: don't remove from a list in a loop...
Martin von Zweigbergk -
r44497:df82c06e default
parent child Browse files
Show More
@@ -3082,14 +3082,13 b' def _dograft(ui, repo, *revs, **opts):'
3082 3082 crev = repo[b'.'].rev()
3083 3083 ancestors = repo.changelog.ancestors([crev], inclusive=True)
3084 3084 # XXX make this lazy in the future
3085 # don't mutate while iterating, create a copy
3086 for rev in list(revs):
3085 for rev in revs:
3087 3086 if rev in ancestors:
3088 3087 ui.warn(
3089 3088 _(b'skipping ancestor revision %d:%s\n') % (rev, repo[rev])
3090 3089 )
3091 # XXX remove on list is slow
3092 revs.remove(rev)
3090 revs = [r for r in revs if r not in ancestors]
3091
3093 3092 if not revs:
3094 3093 return -1
3095 3094
General Comments 0
You need to be logged in to leave comments. Login now