changeset 4082:6b2909e84203

convert-repo converts symlinks from git
author Daniel Holth <dholth@fastmail.fm>
date Tue, 30 Jan 2007 23:09:06 -0500
parents e6d26e71f049
children 33c369afec94
files contrib/convert-repo
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/convert-repo	Tue Feb 13 10:25:45 2007 -0200
+++ b/contrib/convert-repo	Tue Jan 30 23:09:06 2007 -0500
@@ -253,7 +253,7 @@
                 data = self.readp.read(count)
             else:
                 if line == "ok\n":
-                    return (data, "x" in mode)
+                    return (data, "x" in mode and "x" or "")
                 elif line.startswith("E "):
                     warn("cvs server: %s\n" % line[2:])
                 elif line.startswith("Remove"):
@@ -321,7 +321,8 @@
             m = m.split()
             h = m[3]
             p = (m[1] == "100755")
-            self.modecache[(f, h)] = p
+            s = (m[1] == "120000")
+            self.modecache[(f, h)] = (p and "x") or (s and "l") or ""
             changes.append((f, h))
         return changes
 
@@ -390,7 +391,7 @@
         return [ hg.hex(x) for x in h ]
 
     def putfile(self, f, e, data):
-        self.repo.wwrite(f, data, e and 'x' or '')
+        self.repo.wwrite(f, data, e)
         if self.repo.dirstate.state(f) == '?':
             self.repo.dirstate.update([f], "a")