##// END OF EJS Templates
Fix the directory and revlog collision problem...
mpm@selenic.com -
r786:902b12d5 default
parent child Browse files
Show More
@@ -16,8 +16,22 b' demandload(globals(), "bisect select")'
16 class filelog(revlog):
16 class filelog(revlog):
17 def __init__(self, opener, path):
17 def __init__(self, opener, path):
18 revlog.__init__(self, opener,
18 revlog.__init__(self, opener,
19 os.path.join("data", path + ".i"),
19 os.path.join("data", self.encodedir(path + ".i")),
20 os.path.join("data", path + ".d"))
20 os.path.join("data", self.encodedir(path + ".d")))
21
22 # This avoids a collision between a file named foo and a dir named
23 # foo.i or foo.d
24 def encodedir(self, path):
25 path.replace(".hg/", ".hg.hg/")
26 path.replace(".i/", ".i.hg/")
27 path.replace(".d/", ".i.hg/")
28 return path
29
30 def decodedir(self, path):
31 path.replace(".d.hg/", ".d/")
32 path.replace(".i.hg/", ".i/")
33 path.replace(".hg.hg/", ".hg/")
34 return path
21
35
22 def read(self, node):
36 def read(self, node):
23 t = self.revision(node)
37 t = self.revision(node)
General Comments 0
You need to be logged in to leave comments. Login now