rebase: allow destination-free continue and abort (issue5513)
authorRyan McElroy <rmcelroy@fb.com>
Thu, 30 Mar 2017 03:50:10 -0700
changeset 31736 b5afec71c1f9
parent 31735 6931c3346551
child 31737 9ddf875183b0
rebase: allow destination-free continue and abort (issue5513)
hgext/rebase.py
tests/test-rebase-dest.t
--- a/hgext/rebase.py	Thu Mar 30 03:50:10 2017 -0700
+++ b/hgext/rebase.py	Thu Mar 30 03:50:10 2017 -0700
@@ -685,12 +685,6 @@
 
         # Validate input and define rebasing points
         destf = opts.get('dest', None)
-
-        if ui.configbool('commands', 'rebase.requiredest'):
-            if not destf:
-                raise error.Abort(_('you must specify a destination'),
-                                  hint=_('use: hg rebase -d REV'))
-
         srcf = opts.get('source', None)
         basef = opts.get('base', None)
         revf = opts.get('rev', [])
@@ -776,6 +770,10 @@
     cmdutil.checkunfinished(repo)
     cmdutil.bailifchanged(repo)
 
+    if ui.configbool('commands', 'rebase.requiredest') and not destf:
+        raise error.Abort(_('you must specify a destination'),
+                          hint=_('use: hg rebase -d REV'))
+
     if destf:
         dest = scmutil.revsingle(repo, destf)
 
--- a/tests/test-rebase-dest.t	Thu Mar 30 03:50:10 2017 -0700
+++ b/tests/test-rebase-dest.t	Thu Mar 30 03:50:10 2017 -0700
@@ -55,6 +55,5 @@
   (no more unresolved files)
   continue: hg rebase --continue
   $ hg rebase --continue
-  abort: you must specify a destination
-  (use: hg rebase -d REV)
-  [255]
+  rebasing 3:0537f6b50def "dc" (tip)
+  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-backup.hg (glob)