[PATCH 13 of 23 v2] rebase: move 'contf or abortf' validation piece to the rebase runtime class
Kostia Balytskyi
ikostia at fb.com
Tue May 31 19:23:33 EDT 2016
# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1464602476 -3600
# Mon May 30 11:01:16 2016 +0100
# Node ID 6a0627313e255d3fefe92e11fe5ea808c636a40b
# Parent 2a0d59f6a5151211443db5d397eb74bb61d054ca
rebase: move 'contf or abortf' validation piece to the rebase runtime class
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -180,6 +180,18 @@
raise error.Abort(
_('message can only be specified with collapse'))
+ if self.contf or self.abortf:
+ if self.contf and self.abortf:
+ raise error.Abort(_('cannot use both abort and continue'))
+ if self.collapsef:
+ raise error.Abort(
+ _('cannot use collapse with continue or abort'))
+ if self.srcf or self.basef or self.destf:
+ raise error.Abort(
+ _('abort and continue do not allow specifying revisions'))
+ if self.abortf and self.opts.get('tool', False):
+ ui.warn(_('tool option will be ignored\n'))
+
@command('rebase',
[('s', 'source', '',
_('rebase the specified changeset and descendants'), _('REV')),
@@ -299,17 +311,6 @@
lock = repo.lock()
if rtstate.contf or rtstate.abortf:
- if rtstate.contf and rtstate.abortf:
- raise error.Abort(_('cannot use both abort and continue'))
- if rtstate.collapsef:
- raise error.Abort(
- _('cannot use collapse with continue or abort'))
- if rtstate.srcf or rtstate.basef or rtstate.destf:
- raise error.Abort(
- _('abort and continue do not allow specifying revisions'))
- if rtstate.abortf and opts.get('tool', False):
- ui.warn(_('tool option will be ignored\n'))
-
try:
(rtstate.originalwd, rtstate.target, rtstate.state,
rtstate.skipped, rtstate.collapsef, rtstate.keepf,
More information about the Mercurial-devel
mailing list