mercurial/store.py
changeset 18435 8c019d2fd7c0
parent 18430 0459c6555f69
child 19177 1e104aaa4c44
--- a/mercurial/store.py	Wed Dec 12 13:09:36 2012 -0800
+++ b/mercurial/store.py	Wed Dec 12 13:09:37 2012 -0800
@@ -255,22 +255,17 @@
     return res
 
 def _pathencode(path):
+    de = encodedir(path)
     if len(path) > _maxstorepathlen:
-        return None
-    ef = _encodefname(encodedir(path)).split('/')
+        return _hashencode(de, True)
+    ef = _encodefname(de).split('/')
     res = '/'.join(_auxencode(ef, True))
     if len(res) > _maxstorepathlen:
-        return None
+        return _hashencode(de, True)
     return res
 
 _pathencode = getattr(parsers, 'pathencode', _pathencode)
 
-def _dothybridencode(f):
-    ef = _pathencode(f)
-    if ef is None:
-        return _hashencode(encodedir(f), True)
-    return ef
-
 def _plainhybridencode(f):
     return _hybridencode(f, False)
 
@@ -456,7 +451,7 @@
 class fncachestore(basicstore):
     def __init__(self, path, vfstype, dotencode):
         if dotencode:
-            encode = _dothybridencode
+            encode = _pathencode
         else:
             encode = _plainhybridencode
         self.encode = encode