dirstate: refresh _branch cache entry after writing it
authorIdan Kamara <idankk86@gmail.com>
Sun, 16 Dec 2012 20:33:00 +0200
changeset 18317 365fecd984c7
parent 18316 f36375576ed5
child 18318 948f495fb230
dirstate: refresh _branch cache entry after writing it
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon Dec 17 15:25:45 2012 +0200
+++ b/mercurial/dirstate.py	Sun Dec 16 20:33:00 2012 +0200
@@ -265,6 +265,12 @@
         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