changeset 6144:de82085e7f03

fixup: register state in older hg versions
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 22 Feb 2022 19:09:49 +0300
parents 11a3ec836a65
children 1a20edff5cbd
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Tue Feb 22 18:55:12 2022 +0300
+++ b/hgext3rd/evolve/__init__.py	Tue Feb 22 19:09:49 2022 +0300
@@ -1151,6 +1151,11 @@
              b'(also see `hg help evolve.interrupted`)')
     return cmdutil._commentlines(_msg)
 
+def _fixupmessage():
+    _msg = _(b'To continue:    hg fixup --continue\n'
+             b'To abort:       hg fixup --abort\n')
+    return cmdutil._commentlines(_msg)
+
 @eh.uisetup
 def setupevolveunfinished(ui):
     if not util.safehasattr(cmdutil, 'unfinishedstates'):
@@ -1177,16 +1182,22 @@
         pstate = (b'pickstate', False, False, _(b'pick in progress'),
                   _(b"use 'hg pick --continue' or 'hg pick --abort' to abort"))
         cmdutil.unfinishedstates.append(pstate)
+        fstate = (b'fixup-state', False, False, _(b'fixup in progress'),
+                  _(b"use 'hg fixup --continue' or 'hg fixup --abort' to abort"))
+        cmdutil.unfinishedstates.append(fstate)
 
         afterresolved = (b'evolvestate', _(b'hg evolve --continue'))
         pickresolved = (b'pickstate', _(b'hg pick --continue'))
+        fixupresolved = (b'fixup-state', _(b'hg fixup --continue'))
         cmdutil.afterresolvedstates.append(afterresolved)
         cmdutil.afterresolvedstates.append(pickresolved)
+        cmdutil.afterresolvedstates.append(fixupresolved)
 
     if util.safehasattr(cmdutil, 'STATES'):
-        statedata = (b'evolve', cmdutil.fileexistspredicate(b'evolvestate'),
-                     _evolvemessage)
-        cmdutil.STATES = (statedata, ) + cmdutil.STATES
+        cmdutil.STATES = (
+            (b'evolve', cmdutil.fileexistspredicate(b'evolvestate'), _evolvemessage),
+            (b'fixup', cmdutil.fileexistspredicate(b'fixup-state'), _fixupmessage),
+        ) + cmdutil.STATES
 
 @eh.wrapfunction(hg, 'clean')
 def clean(orig, repo, *args, **kwargs):