[PATCH 12 of 16] rebase: move 'contf or abortf' validation piece to the rebase runtime object
Kostia Balytskyi
ikostia at fb.com
Sun May 29 22:38:43 UTC 2016
# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1464547531 -3600
# Sun May 29 19:45:31 2016 +0100
# Node ID 093516642f0fb8a86a1bb7788f2be4684a6c6f37
# Parent 53fe86cc5c32e109a85ca689428d0cebbcd1897e
rebase: move 'contf or abortf' validation piece to the rebase runtime object
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -179,6 +179,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')),
@@ -298,17 +310,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