diff hgext/convert/monotone.py @ 7957:88a2687fbd38

right way to check if file was in renamed directory, fixes import monotone repos with renamed directories
author Pavel Volkovitskiy <int@mtx.ru>
date Thu, 02 Apr 2009 22:25:49 +0400
parents 4a4c7f6a5912
children db3a68fd9387
line wrap: on
line diff
--- a/hgext/convert/monotone.py	Thu Apr 02 14:48:06 2009 +0200
+++ b/hgext/convert/monotone.py	Thu Apr 02 22:25:49 2009 +0400
@@ -111,9 +111,8 @@
     def mtnrenamefiles(self, files, fromdir, todir):
         renamed = {}
         for tofile in files:
-            suffix = tofile.lstrip(todir)
-            if todir + suffix == tofile:
-                renamed[tofile] = (fromdir + suffix).lstrip("/")
+            if tofile.startswith(todir):
+                renamed[tofile] = fromdir + tofile[len(todir):]
         return renamed