diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -627,25 +627,30 @@ STATES = ( # (state, predicate to detect states, helpful message function) - ('histedit', fileexistspredicate('histedit-state'), _histeditmsg), - ('bisect', fileexistspredicate('bisect.state'), _bisectmsg), - ('graft', fileexistspredicate('graftstate'), _graftmsg), - ('unshelve', fileexistspredicate('unshelverebasestate'), _unshelvemsg), - ('rebase', fileexistspredicate('rebasestate'), _rebasemsg), + ('histedit', 'histedit-state', _histeditmsg), + ('bisect', 'bisect.state', _bisectmsg), + ('graft', 'graftstate', _graftmsg), + ('unshelve', 'unshelverebasestate', _unshelvemsg), + ('rebase', 'rebasestate', _rebasemsg), # The merge state is part of a list that will be iterated over. # They need to be last because some of the other unfinished states may also # be in a merge or update state (eg. rebase, histedit, graft, etc). # We want those to have priority. - ('merge', _mergepredicate, _mergemsg), + ('merge', None, _mergemsg), ) def _getrepostate(repo): # experimental config: commands.status.skipstates skip = set(repo.ui.configlist('commands', 'status.skipstates')) - for state, statedetectionpredicate, msgfn in STATES: + for state, filename, msgfn in STATES: if state in skip: continue - if statedetectionpredicate(repo): + detected = False + if state == 'merge': + detected = _mergepredicate(repo) + else: + detected = repo.vfs.exists(filename) + if detected: return (state, msgfn) def morestatus(repo, fm):