changeset 856:fbe964ae7325

Fixed encoding of directories ending in .d or .i: One .d and .i was mixed up, and string replace method doesn't work in-place.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 07 Aug 2005 17:41:13 +0100
parents a107c64c76be
children 41b344235bb7
files mercurial/hg.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Sat Aug 06 21:59:22 2005 +0100
+++ b/mercurial/hg.py	Sun Aug 07 17:41:13 2005 +0100
@@ -22,16 +22,16 @@
     # This avoids a collision between a file named foo and a dir named
     # foo.i or foo.d
     def encodedir(self, path):
-        path.replace(".hg/", ".hg.hg/")
-        path.replace(".i/", ".i.hg/")
-        path.replace(".d/", ".i.hg/")
-        return path
+        return (path
+                .replace(".hg/", ".hg.hg/")
+                .replace(".i/", ".i.hg/")
+                .replace(".d/", ".d.hg/"))
 
     def decodedir(self, path):
-        path.replace(".d.hg/", ".d/")
-        path.replace(".i.hg/", ".i/")
-        path.replace(".hg.hg/", ".hg/")
-        return path
+        return (path
+                .replace(".d.hg/", ".d/")
+                .replace(".i.hg/", ".i/")
+                .replace(".hg.hg/", ".hg/"))
 
     def read(self, node):
         t = self.revision(node)