darcs-fast-import: Create symlinks after darcs record
authorMiklos Vajna <vmiklos@frugalware.org>
Sun, 27 Jun 2010 21:03:53 +0000 (23:03 +0200)
committerMiklos Vajna <vmiklos@frugalware.org>
Sun, 27 Jun 2010 21:03:53 +0000 (23:03 +0200)
Otherwise darcs diff will show the file removals but even darcs record
-a won't record them.

exporters/darcs/darcs-fast-import

index fb6a7a2ed10627783b17648ebb69b88bfdeb1251..ff788fab9aafb8f8d032e77bf074ebad26cc5edb 100755 (executable)
@@ -240,6 +240,13 @@ class Handler:
 
                for i in adds:
                        self.invoke_add(i)
+               sock = subprocess.Popen(["darcs", "record", "--ignore-times", "-a", "--pipe"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+               buf = [self.date, self.ident, self.short, self.long]
+               sock.stdin.write("\n".join(buf))
+               sock.stdin.close()
+               self.log("Recording :%s:\n%s" % (self.mark_num, sock.stdout.read()))
+               sock.stdout.close()
+
                for src, path in symlinks:
                        # symlink does not do what we want if path is
                        # already there
@@ -250,13 +257,6 @@ class Handler:
                                else:
                                        shutil.rmtree(path)
                        os.symlink(src, path)
-               sock = subprocess.Popen(["darcs", "record", "--ignore-times", "-a", "--pipe"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
-               buf = [self.date, self.ident, self.short, self.long]
-               sock.stdin.write("\n".join(buf))
-               sock.stdin.close()
-               self.log("Recording :%s:\n%s" % (self.mark_num, sock.stdout.read()))
-               sock.stdout.close()
-
                if self.options.export_marks:
                        # yeah, an xml parser would be better, but
                        # should we mess with encodings just because of