Patchwork [3,of,5,v2] rebase: allow destination-free continue and abort (issue5513)

login
register
mail settings
Submitter Ryan McElroy
Date March 30, 2017, 10:50 a.m.
Message ID <50219901327938be2f4d.1490871035@devbig314.prn1.facebook.com>
Download mbox | patch
Permalink /patch/19842/
State Accepted
Headers show

Comments

Ryan McElroy - March 30, 2017, 10:50 a.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@fb.com>
# Date 1490871010 25200
#      Thu Mar 30 03:50:10 2017 -0700
# Node ID 50219901327938be2f4d6df041b69d7498a7914d
# Parent  8f154b4f7255427303aed7fff2d78ff84e49bfeb
rebase: allow destination-free continue and abort (issue5513)

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -685,12 +685,6 @@  def rebase(ui, repo, **opts):
 
         # 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 @@  def _definesets(ui, repo, destf=None, sr
     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)
 
diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t
--- a/tests/test-rebase-dest.t
+++ b/tests/test-rebase-dest.t
@@ -55,6 +55,5 @@  Requiring dest should not break continue
   (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)