# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits@gmail.com>
# Date 1281599147 -32400
#      Thu Aug 12 16:45:47 2010 +0900
# Node ID ba9957bcfb7c0ed80af68d58436e040f47887c3a
# Parent  e2bce1c717fa4506a99437d5bff9e8dad9361859
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.

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -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/")