mercurial/dirstate.py
changeset 6972 63d1d3e489f8
parent 6971 b3bc518a73c3
child 6973 8c136043867b
--- a/mercurial/dirstate.py	Tue Sep 02 15:08:26 2008 +0200
+++ b/mercurial/dirstate.py	Tue Sep 02 15:12:50 2008 +0200
@@ -28,6 +28,7 @@
     def __init__(self, opener, ui, root):
         self._opener = opener
         self._root = root
+        self._rootdir = os.path.join(root, '')
         self._dirty = False
         self._dirtypl = False
         self._ui = ui
@@ -99,13 +100,14 @@
             raise AttributeError, name
 
     def _join(self, f):
-        return os.path.join(self._root, f)
+        # much faster than os.path.join()
+        return self._rootdir + f
 
     def flagfunc(self, fallback):
         if self._checklink:
             if self._checkexec:
                 def f(x):
-                    p = os.path.join(self._root, x)
+                    p = self._join(x)
                     if os.path.islink(p):
                         return 'l'
                     if util.is_exec(p):
@@ -113,7 +115,7 @@
                     return ''
                 return f
             def f(x):
-                if os.path.islink(os.path.join(self._root, x)):
+                if os.path.islink(self._join(x)):
                     return 'l'
                 if 'x' in fallback(x):
                     return 'x'
@@ -123,7 +125,7 @@
             def f(x):
                 if 'l' in fallback(x):
                     return 'l'
-                if util.is_exec(os.path.join(self._root, x)):
+                if util.is_exec(self._join(x)):
                     return 'x'
                 return ''
             return f