evolve: avoid duplication in graft wrapper stable
authorPatrick Mezard <patrick@mezard.eu>
Sat, 04 Aug 2012 12:48:20 +0200
branchstable
changeset 417 a1fb18ad29a1
parent 416 22f348c25d25
child 418 18a0d96ed559
evolve: avoid duplication in graft wrapper
hgext/evolve.py
--- a/hgext/evolve.py	Sat Aug 04 12:28:21 2012 +0200
+++ b/hgext/evolve.py	Sat Aug 04 12:48:20 2012 +0200
@@ -634,16 +634,15 @@
         lock.release()
 
 def graftwrapper(orig, ui, repo, *revs, **kwargs):
+    obsoleted = kwargs.setdefault('obsolete', [])
     lock = repo.lock()
     try:
         if kwargs.get('old_obsolete'):
-            obsoleted = kwargs.setdefault('obsolete', [])
             if kwargs['continue']:
                 obsoleted.extend(repo.opener.read('graftstate').splitlines())
             else:
                 obsoleted.extend(revs)
         # convert obsolete target into revs to avoid alias joke
-        obsoleted = kwargs.setdefault('obsolete', [])
         obsoleted[:] = [str(i) for i in repo.revs('%lr', obsoleted)]
         if obsoleted and len(revs) > 1: