comparison mercurial/store.py @ 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 d5bd1beff794
children cc39d07d2212
comparison
equal deleted inserted replaced
11789:e2bce1c717fa 11790:ba9957bcfb7c
20 .replace(".hg/", ".hg.hg/") 20 .replace(".hg/", ".hg.hg/")
21 .replace(".i/", ".i.hg/") 21 .replace(".i/", ".i.hg/")
22 .replace(".d/", ".d.hg/")) 22 .replace(".d/", ".d.hg/"))
23 23
24 def decodedir(path): 24 def decodedir(path):
25 if not path.startswith('data/'): 25 if not path.startswith('data/') or ".hg/" not in path:
26 return path 26 return path
27 return (path 27 return (path
28 .replace(".d.hg/", ".d/") 28 .replace(".d.hg/", ".d/")
29 .replace(".i.hg/", ".i/") 29 .replace(".i.hg/", ".i/")
30 .replace(".hg.hg/", ".hg/")) 30 .replace(".hg.hg/", ".hg/"))