Patchwork [09,of,10,v2] dirstate: refresh _branch cache entry after writing it

login
register
mail settings
Submitter Idan Kamara
Date Jan. 10, 2013, 10:10 p.m.
Message ID <1aa000c079722a59fb6a.1357855856@idan>
Download mbox | patch
Permalink /patch/542/
State Accepted
Commit 365fecd984c7beb451bd074585175a70f78d6765
Delegated to: Kevin Bullock
Headers show

Comments

Idan Kamara - Jan. 10, 2013, 10:10 p.m.
# HG changeset patch
# User Idan Kamara <idankk86@gmail.com>
# Date 1355682780 -7200
# Node ID 1aa000c079722a59fb6a83f22f8a7dc513aee912
# Parent  c3254334bda6da3aed066b3208fe4d63427dce2c
dirstate: refresh _branch cache entry after writing it

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -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