diff mercurial/filelog.py @ 8531:810387f59696

filelog encoding: move the encoding/decoding into store the escaping of directories ending with .i or .d doesn't really belong to filelog. we put the encoding/decoding in store instead, for backwards compat, streamclone and the fncache file format still uses the partially encoded filenames.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 20 May 2009 18:35:47 +0200
parents 46293a0c7e9f
children 25e572394f5c
line wrap: on
line diff
--- a/mercurial/filelog.py	Wed May 20 18:35:41 2009 +0200
+++ b/mercurial/filelog.py	Wed May 20 18:35:47 2009 +0200
@@ -10,21 +10,7 @@
 class filelog(revlog.revlog):
     def __init__(self, opener, path):
         revlog.revlog.__init__(self, opener,
-                        "/".join(("data", self.encodedir(path + ".i"))))
-
-    # This avoids a collision between a file named foo and a dir named
-    # foo.i or foo.d
-    def encodedir(self, path):
-        return (path
-                .replace(".hg/", ".hg.hg/")
-                .replace(".i/", ".i.hg/")
-                .replace(".d/", ".d.hg/"))
-
-    def decodedir(self, path):
-        return (path
-                .replace(".d.hg/", ".d/")
-                .replace(".i.hg/", ".i/")
-                .replace(".hg.hg/", ".hg/"))
+                        "/".join(("data", path + ".i")))
 
     def read(self, node):
         t = self.revision(node)