# HG changeset patch # User Idan Kamara # Date 2012-12-16 18:33:00 # Node ID 365fecd984c7beb451bd074585175a70f78d6765 # Parent f36375576ed570f55e5132670a598e3f2676f2b5 dirstate: refresh _branch cache entry after writing it diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -265,6 +265,12 @@ class dirstate(object): try: f.write(self._branch + '\n') f.close() + + # make sure filecache has the correct stat info for _branch after + # replacing the underlying file + ce = self._filecache['_branch'] + if ce: + ce.refresh() except: # re-raises f.discard() raise