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

Idan Kamara idankk86 at gmail.com
Thu Jan 10 16:10:57 CST 2013


# HG changeset patch
# User Idan Kamara <idankk86 at 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.

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') %


More information about the Mercurial-devel mailing list