amend: add a --branch option
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 11 Oct 2011 19:22:41 +0200
changeset 103 23c232a81fbe
parent 102 5111329280f1
child 104 6c3c7a18f079
amend: add a --branch option
hgext/evolution.py
--- a/hgext/evolution.py	Thu Sep 29 15:23:56 2011 +0200
+++ b/hgext/evolution.py	Tue Oct 11 19:22:41 2011 +0200
@@ -209,7 +209,9 @@
     ('n', 'note', '',
      _('use text as commit message for this update')),
     ('c', 'change', '',
-     _('specifies the changeset to amend'), _('REV'))
+     _('specifies the changeset to amend'), _('REV')),
+    ('b', 'branch', '',
+     _('specifies a branch for the new.'), _('REV')),
     ] + walkopts + commitopts + commitopts2,
     _('[OPTION]... [FILE]...'))
 
@@ -243,6 +245,9 @@
     if change == '.':
         change = 'p1(p1())'
     old = scmutil.revsingle(repo, change)
+    branch = opts.get('branch')
+    if branch:
+        opts.setdefault('extra', {})['branch'] = branch
 
     wlock = repo.wlock()
     try: