hgext/evolve.py
changeset 151 e73944b6be8f
parent 147 b0b23d9eede5
child 178 3f18a6580d14
--- a/hgext/evolve.py	Tue Mar 20 15:10:53 2012 +0100
+++ b/hgext/evolve.py	Tue Mar 20 15:18:10 2012 +0100
@@ -316,7 +316,7 @@
     finally:
         wlock.release()
 
-@command('^amend',
+@command('^amend|refresh',
     [('A', 'addremove', None,
      _('mark new/missing files as added/removed before committing')),
     ('n', 'note', '',
@@ -445,6 +445,14 @@
                 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:
+
+            raise error.Abort(_('Can not graft multiple revision while '
+                                'obsoleting (for now).'))
+
         return commitwrapper(orig, ui, repo,*revs, **kwargs)
     finally:
         lock.release()