diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1341,8 +1341,10 @@ class workingctx(committablectx): try: # updating the dirstate is optional # so we don't wait on the lock + # wlock can invalidate the dirstate, so cache normal _after_ + # taking the lock + wlock = self._repo.wlock(False) normal = self._repo.dirstate.normal - wlock = self._repo.wlock(False) try: for f in fixup: normal(f)