Patchwork [12,of,12] localrepo: drop unnecessary check on wlock unlock

login
register
mail settings
Submitter Idan Kamara
Date Dec. 17, 2012, 3:35 p.m.
Message ID <99e9625f02f563fb6916.1355758537@idan>
Download mbox | patch
Permalink /patch/166/
State Superseded
Commit 948f495fb2302a6241787a2d5924ef328f2f4967
Headers show

Comments

Idan Kamara - Dec. 17, 2012, 3:35 p.m.
# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1355690847 -7200
# Branch stable
# Node ID 99e9625f02f563fb69169f26602f11d2cef2227c
# Parent  dfe35839906aaf57d18eeebfc529425de7c0ac85
localrepo: drop unnecessary check on wlock unlock

Calling out to dirstate one line before guarantees that it'll be in the filecache.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1132,9 +1132,7 @@ 
 
         def unlock():
             self.dirstate.write()
-            ce = self._filecache.get('dirstate')
-            if ce:
-                ce.refresh()
+            self._filecache.get('dirstate').refresh()
 
         l = self._lock(self.join("wlock"), wait, unlock,
                        self.invalidatedirstate, _('working directory of %s') %