]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Generalize copy operation.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 12 Nov 2010 23:10:33 +0000 (18:10 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 12 Nov 2010 23:10:33 +0000 (18:10 -0500)
rcs-fast-import

index d6b30efc56aba34957ea5c5fb87bc1529b82ee39..70b864542e9e8fb6dfd40c07920dd27d7966d6fc 100755 (executable)
@@ -665,14 +665,14 @@ class RCS:
         do_or_die(command, legend.lower())
         RCS.record("D", path)
         os.remove(path)
-    def copy(self, source, target):
+    def copy(self, source, target, legend="Copy"):
         "Perform RCS copies. Start the copy with no history."
         uphere = os.path.basename(target)
-        do_or_die("co %s" % RCS.master(source), "copy checkout")
+        do_or_die("co %s" % RCS.master(source), legend)
         os.rename(source, uphere)
-        do_or_die("ci -i -m'Copy of %s' -l %s %s"
-                  % (source, uphere, RCS.master(target)),
-                  "copy")
+        do_or_die("ci -i -m'%s of %s' -l %s %s"
+                  % (legend, source, uphere, RCS.master(target)),
+                  legend.lower())
         RCS.record("C", source)
         RCS.record("T", target)
         os.remove(uphere)