[PATCH 13 of 23 v3] rebase: move continue/abort-related option validation to the RRS class
Kostia Balytskyi
ikostia at fb.com
Thu Jun 2 10:13:54 EDT 2016
# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1464876447 -3600
# Thu Jun 02 15:07:27 2016 +0100
# Node ID 8f9d9fda465afbe7c6af462b085e5b50f4ea6d4c
# Parent 28aa3fea67e31874d03061dbfd39d105fc7b4c53
rebase: move continue/abort-related option validation to the RRS class
This commit moves validation of 'contf' and 'abortf' options to the
validateoptions method of the RebaseRuntimeState 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):
+ self.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