[PATCH 12 of 23 v2] rebase: move collapsef and collapsemsg validation to the rebase runtime class

Kostia Balytskyi ikostia at fb.com
Tue May 31 19:23:32 EDT 2016


# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1464602452 -3600
#      Mon May 30 11:00:52 2016 +0100
# Node ID 2a0d59f6a5151211443db5d397eb74bb61d054ca
# Parent  322f54d305eab7d88fb4e657c8102f7282a87f04
rebase: move collapsef and collapsemsg validation to the rebase runtime 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