Patchwork [3,of,8] localrepo: improve dirstate.normal lookup by cacheing the function

login
register
mail settings
Submitter Sean Farley
Date May 6, 2014, 11:33 p.m.
Message ID <eecae40cba0ea00b3cd5.1399419200@laptop.local>
Download mbox | patch
Permalink /patch/4649/
State Accepted
Commit 20a30cd41d212fcb9eee0941d34b1987fdd5747c
Headers show

Comments

Sean Farley - May 6, 2014, 11:33 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1394577849 18000
#      Tue Mar 11 17:44:09 2014 -0500
# Node ID eecae40cba0ea00b3cd5d1284f820d65fb32d6b4
# Parent  e8cfd36c584cb7aafeb51830592176e69061eb46
localrepo: improve dirstate.normal lookup by cacheing the function

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1569,14 +1569,15 @@  class localrepository(object):
                         clean += fixup
 
                     try:
                         # updating the dirstate is optional
                         # so we don't wait on the lock
+                        normal = self._repo.dirstate.normal
                         wlock = self.wlock(False)
                         try:
                             for f in fixup:
-                                self.dirstate.normal(f)
+                                normal(f)
                         finally:
                             wlock.release()
                     except error.LockError:
                         pass