##// END OF EJS Templates
states: moved cmdutil.unfinishedstates to state.py...
Taapas Agrawal -
r42729:5f2f6912 default
parent child Browse files
Show More
@@ -2313,7 +2313,7 b' def summaryhook(ui, repo):'
2313 2313
2314 2314 def extsetup(ui):
2315 2315 cmdutil.summaryhooks.add('histedit', summaryhook)
2316 cmdutil.unfinishedstates.append(
2316 statemod.unfinishedstates.append(
2317 2317 ['histedit-state', False, True, _('histedit in progress'),
2318 2318 _("use 'hg histedit --continue' or 'hg histedit --abort'")])
2319 2319 cmdutil.afterresolvedstates.append(
@@ -1950,7 +1950,7 b' def uisetup(ui):'
1950 1950 entry[1].append(('t', 'tool', '',
1951 1951 _("specify merge tool for rebase")))
1952 1952 cmdutil.summaryhooks.add('rebase', summaryhook)
1953 cmdutil.unfinishedstates.append(
1953 statemod.unfinishedstates.append(
1954 1954 ['rebasestate', False, False, _('rebase in progress'),
1955 1955 _("use 'hg rebase --continue' or 'hg rebase --abort'")])
1956 1956 cmdutil.afterresolvedstates.append(
@@ -48,6 +48,7 b' from mercurial import ('
48 48 registrar,
49 49 repair,
50 50 scmutil,
51 state as statemod,
51 52 templatefilters,
52 53 util,
53 54 vfs as vfsmod,
@@ -1139,9 +1140,10 b' def shelvecmd(ui, repo, *pats, **opts):'
1139 1140 return createcmd(ui, repo, pats, opts)
1140 1141
1141 1142 def extsetup(ui):
1142 cmdutil.unfinishedstates.append(
1143 statemod.unfinishedstates.append(
1143 1144 [shelvedstate._filename, False, False,
1144 1145 _('unshelve already in progress'),
1145 1146 _("use 'hg unshelve --continue' or 'hg unshelve --abort'")])
1146 1147 cmdutil.afterresolvedstates.append(
1147 1148 [shelvedstate._filename, _('hg unshelve --continue')])
1149
@@ -35,6 +35,7 b' from mercurial import ('
35 35 revset,
36 36 scmutil,
37 37 smartset,
38 state as statemod,
38 39 util,
39 40 vfs as vfsmod,
40 41 )
@@ -757,7 +758,7 b' def kwtransplanted(context, mapping):'
757 758 return n and nodemod.hex(n) or ''
758 759
759 760 def extsetup(ui):
760 cmdutil.unfinishedstates.append(
761 statemod.unfinishedstates.append(
761 762 ['transplant/journal', True, False, _('transplant in progress'),
762 763 _("use 'hg transplant --continue' or 'hg update' to abort")])
763 764
@@ -42,6 +42,7 b' from . import ('
42 42 rewriteutil,
43 43 scmutil,
44 44 smartset,
45 state as statemod,
45 46 subrepoutil,
46 47 templatekw,
47 48 templater,
@@ -3313,17 +3314,6 b' summaryhooks = util.hooks()'
3313 3314 # - (desturl, destbranch, destpeer, outgoing)
3314 3315 summaryremotehooks = util.hooks()
3315 3316
3316 # A list of state files kept by multistep operations like graft.
3317 # Since graft cannot be aborted, it is considered 'clearable' by update.
3318 # note: bisect is intentionally excluded
3319 # (state file, clearable, allowcommit, error, hint)
3320 unfinishedstates = [
3321 ('graftstate', True, False, _('graft in progress'),
3322 _("use 'hg graft --continue' or 'hg graft --stop' to stop")),
3323 ('updatestate', True, False, _('last update was interrupted'),
3324 _("use 'hg update' to get a consistent checkout"))
3325 ]
3326
3327 3317 def checkunfinished(repo, commit=False):
3328 3318 '''Look for an unfinished multistep operation, like graft, and abort
3329 3319 if found. It's probably good to check this right before
@@ -3331,13 +3321,13 b' def checkunfinished(repo, commit=False):'
3331 3321 '''
3332 3322 # Check for non-clearable states first, so things like rebase will take
3333 3323 # precedence over update.
3334 for f, clearable, allowcommit, msg, hint in unfinishedstates:
3324 for f, clearable, allowcommit, msg, hint in statemod.unfinishedstates:
3335 3325 if clearable or (commit and allowcommit):
3336 3326 continue
3337 3327 if repo.vfs.exists(f):
3338 3328 raise error.Abort(msg, hint=hint)
3339 3329
3340 for f, clearable, allowcommit, msg, hint in unfinishedstates:
3330 for f, clearable, allowcommit, msg, hint in statemod.unfinishedstates:
3341 3331 if not clearable or (commit and allowcommit):
3342 3332 continue
3343 3333 if repo.vfs.exists(f):
@@ -3347,10 +3337,10 b' def clearunfinished(repo):'
3347 3337 '''Check for unfinished operations (as above), and clear the ones
3348 3338 that are clearable.
3349 3339 '''
3350 for f, clearable, allowcommit, msg, hint in unfinishedstates:
3340 for f, clearable, allowcommit, msg, hint in statemod.unfinishedstates:
3351 3341 if not clearable and repo.vfs.exists(f):
3352 3342 raise error.Abort(msg, hint=hint)
3353 for f, clearable, allowcommit, msg, hint in unfinishedstates:
3343 for f, clearable, allowcommit, msg, hint in statemod.unfinishedstates:
3354 3344 if clearable and repo.vfs.exists(f):
3355 3345 util.unlink(repo.vfs.join(f))
3356 3346
@@ -6148,7 +6148,6 b' def update(ui, repo, node=None, **opts):'
6148 6148
6149 6149 with repo.wlock():
6150 6150 cmdutil.clearunfinished(repo)
6151
6152 6151 if date:
6153 6152 rev = cmdutil.finddate(ui, repo, date)
6154 6153
@@ -19,6 +19,8 b' the data.'
19 19
20 20 from __future__ import absolute_import
21 21
22 from .i18n import _
23
22 24 from . import (
23 25 error,
24 26 util,
@@ -85,3 +87,14 b' class cmdstate(object):'
85 87 def exists(self):
86 88 """check whether the state file exists or not"""
87 89 return self._repo.vfs.exists(self.fname)
90
91 # A list of state files kept by multistep operations like graft.
92 # Since graft cannot be aborted, it is considered 'clearable' by update.
93 # note: bisect is intentionally excluded
94 # (state file, clearable, allowcommit, error, hint)
95 unfinishedstates = [
96 ('graftstate', True, False, _('graft in progress'),
97 _("use 'hg graft --continue' or 'hg graft --stop' to stop")),
98 ('updatestate', True, False, _('last update was interrupted'),
99 _("use 'hg update' to get a consistent checkout"))
100 ]
General Comments 0
You need to be logged in to leave comments. Login now