]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Add author and date metadata.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 10 Nov 2010 21:23:44 +0000 (16:23 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 10 Nov 2010 21:23:44 +0000 (16:23 -0500)
rcs-fast-import

index d247f887a6bd412d9a8dbb3a93f81fba6687898b..01cd98db7c5ec043cf994faae8661a606e6c4178 100755 (executable)
@@ -36,7 +36,9 @@ If D, R, or C operations are present, the conversion will not round-trip
 properly (that is, rcs-fast-export | rcs-fast-import won't be an exact
 copy) with differences near deleted, renamed, and copied files.
 
-Warning: All tag metadata other than the name will be lost.
+Warning: All tag metadata other than the name will be lost.  The person
+and date imputed to commits is from the author metadata if that exists,
+otherwise from the committer metadata.
 """
 
 import sys, os, getopt, re, cStringIO, subprocess, shutil
@@ -597,7 +599,12 @@ class RCS:
                              % (copyfile, os.path.dirname(path) or '.'))
                 if not dryrun:
                     shutil.copy(copyfile, os.path.dirname(path))
-            with popen_or_die("ci " + " ".join(inargs), "checkin", "w") as fp:
+            responsible = event.authors[0] or event.committer
+            command = "ci "
+            command += " -w%s" % responsible.email
+            command += " -d'%s'" % responsible.date.rfc822()
+            command += " " + " ".join(inargs)
+            with popen_or_die(command, "checkin", "w") as fp:
                 fp.write(event.comment)
     def rename(self, source, target):
         "Perform RCS renames."