]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Better handling of copies.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 11 Nov 2010 17:51:46 +0000 (12:51 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 11 Nov 2010 17:51:46 +0000 (12:51 -0500)
rcs-fast-import

index 288e560b70e328ab89ab31b8fd648544dba587ad..679d92347b356b495762ed4b175eff356f9fd231 100755 (executable)
@@ -614,12 +614,13 @@ class RCS:
         # than doing nothing.
         os.rename(RCS.master(op.source), RCS.master(op.target))
     def copy(self, source, target):
-        "Perform RCS copies."
-        # The copy will get the original's history.
-        # There's a case that what we ought to do instead
-        # is check out the tip rev and use it to initialize
-        # a new master.
-        shutil.copy(RCS.master(source), RCS.master(target))
+        "Perform RCS copies. Start the copy with no history"
+        uphere = os.path.basename(target)
+        do_or_die("co %s" % RCS.master(source), "copy checkout")
+        os.rename(source, here)
+        do_or_die("ci -i -m'Copy of %s' -l %s %s"
+                  % (source, uphere, RCS.master(target)))
+        os.remove(uphere)
     def checkout(self, switch):
         "Post-conversion actions."
         if switch != '-l':