From: Eric S. Raymond Date: Mon, 15 Nov 2010 19:02:43 +0000 (-0500) Subject: Preserve merge and extension-property metadata. X-Git-Tag: 0.1~6 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=91952409d9f3b38e6f5a1deac41053b392edf63a;p=rcs-fast-import.git Preserve merge and extension-property metadata. --- diff --git a/rcs-fast-import b/rcs-fast-import index e649d93..5258d39 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -219,6 +219,7 @@ class Commit: return filter(lambda e:e.mark in self.parent_marks,self.repo.commits()) def is_tip(self): "Is this commit a branch tip?" + # Added for rcs-fast-import for child in self.children(): if child.branch == self.branch: return False @@ -243,6 +244,10 @@ class Commit: msg["Property-" + hdr] = value if empty_properties: msg["Empty-Properties"] = ",".join(empty_properties) + # This is added for rcs-fast-import + msg["Mark"] = self.mark + if self.parent_marks: + msg["Parents"] = ", ".join(self.parent_marks) msg.set_payload(self.comment) return msg.as_string(False) @@ -269,6 +274,7 @@ class Repository: self.branches = set([]) self.import_line = 0 self.basedir = os.getcwd() + # __enter and __exit__ added for rcs-fast-import def __enter__(self): return self def __exit__(self, type, value, traceback): @@ -500,6 +506,7 @@ class Repository: self.import_line = 0 self.readtime = time.time() # Resolve tags and branches + # Added for rcs-fast-import for event in self.events: if isinstance(event, Tag): for commit in self.commits(): diff --git a/rcs-fast-import.xml b/rcs-fast-import.xml index 684de34..3e275ca 100644 --- a/rcs-fast-import.xml +++ b/rcs-fast-import.xml @@ -34,9 +34,12 @@ stdin into individual RCS master files in RCS subdirectories of the corresponding directory structure. -Normally, committer and author data are written into each comment as -RFC-822 mail headers, followed by a blank line. The -p option suppresses -this, producing a plain RCS comment. +Normally, all import-stream per-commit metadata that RCS cannot +represent natively is written into each comment as RFC-822 mail +headers, followed by a blank line; this includes mark, committer and +author data, mark cross-references to parent commits, and extension +properties. The -p option suppresses this, producing a plain RCS +comment. With the -v option, emit a twirling-baton prompt during stream read and do not suppress progess messages from the RCS tools. @@ -65,10 +68,7 @@ has the value of the corresponding RCS branch identifier for that file. BUGS The following limitations are inherent in the RCS format: -RCS has no way to represent merges. Accordingly, the information -in import-stream merge commands is lost. - -Annotated tags cannot be preseved in a format readily accessible +Annotated tags cannot be preserved 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.