Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGceb31d96d3ae: statecheck: updated docstrings related to afterresolvedstates
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/cmdutil.py (9 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
e05668dadfc1 | 6a3872e34503 | Taapas Agrawal | Jul 4 2019, 2:47 PM |
continue | continue | ||||
if s._clearable and s.isunfinished(repo): | if s._clearable and s.isunfinished(repo): | ||||
util.unlink(repo.vfs.join(s._fname)) | util.unlink(repo.vfs.join(s._fname)) | ||||
def howtocontinue(repo): | def howtocontinue(repo): | ||||
'''Check for an unfinished operation and return the command to finish | '''Check for an unfinished operation and return the command to finish | ||||
it. | it. | ||||
afterresolvedstates tuples define a .hg/{file} and the corresponding | statemod._unfinishedstates list is checked for an unfinished operation | ||||
command needed to finish it. | and the corresponding message to finish it is generated if a method to | ||||
continue is supported by the operation. | |||||
Returns a (msg, warning) tuple. 'msg' is a string and 'warning' is | Returns a (msg, warning) tuple. 'msg' is a string and 'warning' is | ||||
a boolean. | a boolean. | ||||
''' | ''' | ||||
contmsg = _("continue: %s") | contmsg = _("continue: %s") | ||||
for state in statemod._unfinishedstates: | for state in statemod._unfinishedstates: | ||||
if not state._continueflag: | if not state._continueflag: | ||||
continue | continue | ||||
if state.isunfinished(repo): | if state.isunfinished(repo): | ||||
return contmsg % state.continuemsg(), True | return contmsg % state.continuemsg(), True | ||||
if repo[None].dirty(missing=True, merge=False, branch=False): | if repo[None].dirty(missing=True, merge=False, branch=False): | ||||
return contmsg % _("hg commit"), False | return contmsg % _("hg commit"), False | ||||
return None, None | return None, None | ||||
def checkafterresolved(repo): | def checkafterresolved(repo): | ||||
'''Inform the user about the next action after completing hg resolve | '''Inform the user about the next action after completing hg resolve | ||||
If there's a matching afterresolvedstates, howtocontinue will yield | If there's a an unfinished operation that supports continue flag, | ||||
repo.ui.warn as the reporter. | howtocontinue will yield repo.ui.warn as the reporter. | ||||
Otherwise, it will yield repo.ui.note. | Otherwise, it will yield repo.ui.note. | ||||
''' | ''' | ||||
msg, warning = howtocontinue(repo) | msg, warning = howtocontinue(repo) | ||||
if msg is not None: | if msg is not None: | ||||
if warning: | if warning: | ||||
repo.ui.warn("%s\n" % msg) | repo.ui.warn("%s\n" % msg) | ||||
else: | else: |