changeset 11790:ba9957bcfb7c

store: skip decodir check if path does not contain '.hg/' The three replace calls are slower than this simple __contains__, and anyway we should not have this many paths ending with .i, .d, or .hg compared to the normal, un-encoded other paths.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Thu, 12 Aug 2010 16:45:47 +0900
parents e2bce1c717fa
children 00cde9bddbe4
files mercurial/store.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Sat Jul 17 00:47:06 2010 +0900
+++ b/mercurial/store.py	Thu Aug 12 16:45:47 2010 +0900
@@ -22,7 +22,7 @@
             .replace(".d/", ".d.hg/"))
 
 def decodedir(path):
-    if not path.startswith('data/'):
+    if not path.startswith('data/') or ".hg/" not in path:
         return path
     return (path
             .replace(".d.hg/", ".d/")