mercurial/store.py
changeset 17584 61cd71dc3797
parent 17574 81a033bb29bc
child 17585 8ed2783f338f
--- a/mercurial/store.py	Mon Sep 17 21:53:50 2012 +0200
+++ b/mercurial/store.py	Sat Sep 15 21:43:14 2012 +0200
@@ -200,13 +200,11 @@
     '''
     if not path.startswith('data/'):
         return path
-    # escape directories ending with .i and .d
-    path = encodedir(path)
-    ndpath = path[len('data/'):]
-    res = 'data/' + '/'.join(auxencode(encodefilename(ndpath)))
+    res = '/'.join(auxencode(encodefilename(path)))
     if len(res) > _maxstorepathlen:
+        path = encodedir(path)
         digest = _sha(path).hexdigest()
-        parts = auxencode(lowerencode(ndpath))
+        parts = auxencode(lowerencode(path))[1:]
         _root, ext = os.path.splitext(parts[-1])
         basename = parts[-1]
         sdirs = []