diff -r ff02bb5979c1 -r add613cddcb6 mercurial/context.py --- a/mercurial/context.py Tue Jun 13 10:02:34 2017 -0400 +++ b/mercurial/context.py Mon Jun 12 13:54:59 2017 -0700 @@ -1738,7 +1738,10 @@ # it's in the dirstate. deleted.append(f) - # update dirstate for files that are actually clean + return modified, deleted, fixup + + def _poststatusfixup(self, fixup): + """update dirstate for files that are actually clean""" if fixup: try: oldid = self._repo.dirstate.identity() @@ -1767,7 +1770,6 @@ 'identity mismatch\n') except error.LockError: pass - return modified, deleted, fixup def _dirstatestatus(self, match=None, ignored=False, clean=False, unknown=False): @@ -1781,15 +1783,17 @@ listclean, listunknown) # check for any possibly clean files + fixup = [] if cmp: modified2, deleted2, fixup = self._checklookup(cmp) s.modified.extend(modified2) s.deleted.extend(deleted2) - # update dirstate for files that are actually clean if fixup and listclean: s.clean.extend(fixup) + self._poststatusfixup(fixup) + if match.always(): # cache for performance if s.unknown or s.ignored or s.clean: