From: Eric S. Raymond Date: Thu, 11 Nov 2010 19:35:13 +0000 (-0500) Subject: We now store amnnotated tags in a round-trippable form. X-Git-Tag: 0.1~49 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=0868872f5685f87740032eb7d8c9fe8661d347c1;p=rcs-fast-import.git We now store amnnotated tags in a round-trippable form. --- diff --git a/Makefile b/Makefile index 5eb34d4..05ae43b 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,32 @@ # -# makefile for rcs-fast-export +# makefile for rcs-fast-import # -VERS=$(shell sed MANIFEST - @(cd ..; ln -s rcs-fast-export rcs-fast-export-$(VERS)) - (cd ..; tar -czvf rcs-fast-export/rcs-fast-export-$(VERS).tar.gz `cat rcs-fast-export/MANIFEST`) - @(cd ..; rm rcs-fast-export-$(VERS)) +rcs-fast-import-$(VERS).tar.gz: $(SOURCES) rcs-fast-import.1 + @ls $(SOURCES) rcs-fast-import.1 | sed s:^:rcs-fast-import-$(VERS)/: >MANIFEST + @(cd ..; ln -s rcs-fast-import rcs-fast-import-$(VERS)) + (cd ..; tar -czvf rcs-fast-import/rcs-fast-import-$(VERS).tar.gz `cat rcs-fast-import/MANIFEST`) + @(cd ..; rm rcs-fast-import-$(VERS)) version: @echo $(VERS) -dist: rcs-fast-export-$(VERS).tar.gz +dist: rcs-fast-import-$(VERS).tar.gz -release: rcs-fast-export-$(VERS).tar.gz rcs-fast-export.html +release: rcs-fast-import-$(VERS).tar.gz rcs-fast-import.html shipper -u -m -t; make clean diff --git a/rcs-fast-import b/rcs-fast-import index 679d923..fb9c716 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -170,10 +170,8 @@ class Tag: self.committish = committish self.tagger = tagger self.comment = content - def email_out(self, eventnum): - "Enable do_mailbox_out() to report these." + def email_out(self): msg = email.message.Message() - msg["Event-Number"] = str(eventnum+1) msg["Tag-Name"] = self.name if self.tagger: self.tagger.email_out(msg, "Tagger") @@ -228,7 +226,6 @@ class Commit: return False return True def email_out(self): - "Enable do_mailbox_out() to report these." msg = email.message.Message() if self.authors: self.authors[0].email_out(msg, "Author") @@ -603,8 +600,15 @@ class RCS: announce("removing %s" % (path,)) if not dryrun: os.remove(path) + # Save annotated tags for round-tripping for tag in event.taglist: + with file("RCS/ANNOTATED-TAGS", "w") as fp: + fp.write(tag.email_out()) + do_or_die("ci -l -m'Annotated tag %s' -d'%s' RCS/ANNOTATED-TAGS,v" + % (tag.name, tag.tagger.date.rfc822())) + os.remove("RCS/ANNOTATED-TAGS") do_or_die("rcs -n'%s': %s" % (tag.name, " ".join(RCS.rcsfiles()))) + # FIXME: Someday, do real branch structure here. if event.is_tip(): do_or_die("rcs -n'%s': %s" % (event.branch, " ".join(RCS.rcsfiles()))) def rename(self, source, target): diff --git a/rcs-fast-import.xml b/rcs-fast-import.xml index a643fc9..5119825 100644 --- a/rcs-fast-import.xml +++ b/rcs-fast-import.xml @@ -68,10 +68,15 @@ initialize a new file. BUGS The following limitations are inherent in the RCS format: +Annotated tags cannot be preseved in a format readily accessible +to RCS. This tool deposits them as tagged revisions of a file named +ANNOTATED-TAGS in the toplevel RCS +directory. + If D or R operations are present in the import stream, the conversion will not round-trip properly (that is the file structure after rcs-fast-export | rcs-fast-import won't be an exact copy) with -differences near deleted and renamed. +differences near deleted and renamed files. In each commit, the committer date entered in RCS metadata will be the committer date from the import stream, but the committer @@ -93,8 +98,6 @@ fixed in a future release: 5.7. It is likely older versions will throw errors on some tag and branch names that are legal in fast-import files. -All annotated-tag metadata other than the tag name will be lost. - Branch structure in the input stream is not yet mapped to RCS branches. Round-tripping will fail if the history in the import stream was not linear.