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

login
register
mail settings
Submitter Idan Kamara
Date Jan. 10, 2013, 10:10 p.m.
Message ID <d2822705c5bd7b1cf36b.1357855857@idan>
Download mbox | patch
Permalink /patch/524/
State Accepted
Commit 948f495fb2302a6241787a2d5924ef328f2f4967
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 1357855023 -7200
# Node ID d2822705c5bd7b1cf36b1ba5949ad62b0f811b56
# Parent  1aa000c079722a59fb6a83f22f8a7dc513aee912
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
@@ -1033,9 +1033,7 @@ 
 
         def unlock():
             self.dirstate.write()
-            ce = self._filecache.get('dirstate')
-            if ce:
-                ce.refresh()
+            self._filecache['dirstate'].refresh()
 
         l = self._lock(self.join("wlock"), wait, unlock,
                        self.invalidatedirstate, _('working directory of %s') %