diff hgext/shelve.py @ 42537:dc3fdd1b5af4

state: created new class statecheck to handle unfinishedstates For the purpose of handling states for various multistep operations like `hg graft`, `hg histedit`, `hg bisect` et al a new class called statecheck is created .This will help in having a unified approach towards these commands and handle them with ease. The class takes in 4 basic arguments which include the name of the command, the name of the state file associated with it , clearable flag , allowcommit flag. This also also adds the support of`checkunfinished()` and `clearunfinished()` to the class. Tests remain unchanged. Differential Revision: https://phab.mercurial-scm.org/D6501
author Taapas Agrawal <taapas2897@gmail.com>
date Sun, 09 Jun 2019 00:43:36 +0530
parents 5f2f6912c9e6
children 0231032729c4
line wrap: on
line diff
--- a/hgext/shelve.py	Sat Jun 08 23:43:53 2019 +0530
+++ b/hgext/shelve.py	Sun Jun 09 00:43:36 2019 +0530
@@ -1140,10 +1140,9 @@
         return createcmd(ui, repo, pats, opts)
 
 def extsetup(ui):
-    statemod.unfinishedstates.append(
-        [shelvedstate._filename, False, False,
-         _('unshelve already in progress'),
-         _("use 'hg unshelve --continue' or 'hg unshelve --abort'")])
+    statemod.addunfinished(
+        'unshelve', fname=shelvedstate._filename,
+        cmdmsg=_('unshelve already in progress')
+    )
     cmdutil.afterresolvedstates.append(
         [shelvedstate._filename, _('hg unshelve --continue')])
-