[PATCH 12 of 23 v3] rebase: move collapse-related options validation to the RRS class

Kostia Balytskyi ikostia at fb.com
Thu Jun 2 10:13:53 EDT 2016


# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1464871051 -3600
#      Thu Jun 02 13:37:31 2016 +0100
# Node ID 28aa3fea67e31874d03061dbfd39d105fc7b4c53
# Parent  af65a1c2290b483eb643576ab1b7835fa1b3bc5b
rebase: move collapse-related options validation to the RRS class

This commit moves validation of collapsef and collapsemsg 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
@@ -176,6 +176,10 @@
                     "'histedit' extension (see \"%s\")") % help
             raise error.Abort(msg)
 
+        if self.collapsemsg and not self.collapsef:
+            raise error.Abort(
+                _('message can only be specified with collapse'))
+
 @command('rebase',
     [('s', 'source', '',
      _('rebase the specified changeset and descendants'), _('REV')),
@@ -294,10 +298,6 @@
         wlock = repo.wlock()
         lock = repo.lock()
 
-        if rtstate.collapsemsg and not rtstate.collapsef:
-            raise error.Abort(
-                _('message can only be specified with collapse'))
-
         if rtstate.contf or rtstate.abortf:
             if rtstate.contf and rtstate.abortf:
                 raise error.Abort(_('cannot use both abort and continue'))


More information about the Mercurial-devel mailing list