def email_out(self, eventnum):
"Enable do_mailbox_out() to report these."
msg = email.message.Message()
- msg.set_unixfrom(None)
msg["Event-Number"] = str(eventnum+1)
msg["Tag-Name"] = self.name
if self.tagger:
self.tagger.email_out(msg, "Tagger")
msg.set_payload(self.comment)
- return str(msg)
+ return msg.as_string(False)
class Reset:
"Represents a branch creation."
self.fileops = [] # blob and file operation list
self.properties = {} # commit properties (extension)
self.taglist = [] # Tags that point at this commit
+ def children(self):
+ "Get a list of this commit's children."
+ return filter(lambda e:self.mark in e.parent_marks,self.repo.commits())
+ def is_tip(self):
+ "Is this commit a branch tip?"
+ for child in self.children():
+ if child.branch == self.branch:
+ return False
+ return True
def email_out(self):
"Enable do_mailbox_out() to report these."
msg = email.message.Message()
- msg.set_unixfrom(None)
if self.authors:
self.authors[0].email_out(msg, "Author")
for (i, coauthor) in enumerate(self.authors[1:]):
if empty_properties:
msg["Empty-Properties"] = ",".join(empty_properties)
msg.set_payload(self.comment)
- return str(msg)
+ return msg.as_string(False)
class Passthrough:
"Represents a passthrough line."
"Perform RCS file checkins and modifications,"
for (path, mode, copyfile) in committables:
if mode == "160000":
- announce("ignoring a submodule link %s", path)
- continue
+ raise FatalException("ignoring a submodule link %s", path)
else:
rcsdir = os.path.join(os.path.dirname(path), "RCS")
if not os.path.exists(rcsdir):
os.remove(path)
for tag in event.taglist:
do_or_die("rcs -n'%s': %s" % (tag.name, " ".join(RCS.rcsfiles())))
+ if event.is_tip():
+ do_or_die("rcs -n'%s': %s" % (event.branch, " ".join(RCS.rcsfiles())))
def rename(self, source, target):
"Perform RCS renames."
# Dodgy, but since user is more likely to be
if op.op == "M":
if verbose:
announce("%5s M %s" % (event.mark, op.path))
- committables.append((op.path, op.mode, op.copyname))
+ if op.mode == "160000":
+ complain("cannot represent a submodule link in RCS")
+ else:
+ committables.append((op.path, op.mode, op.copyname))
elif op.op in ("D", "deleteall"):
# If we delete masters, we lose ability to
# retrieve old versions.
<para>R file operations rename corresponding RCS master files; C file operations
copy them.</para>
-<para>If D, R, or C operations are present, 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, renamed, and copied files.</para>
</refsect1>
<refsect1 id='bugs'><title>BUGS</title>
It is likely they will throw errors on some tag and branch names that
are legal in fast-import files.</para>
+<para>The following limitations are inherent in the RCS format:</para>
+
+<para>If D, R, or C 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, renamed, and copied files.</para>
+
<para>In each commit, the committer date entered in RCS metadata will
be the committer date from the import stream, but the committer
identity will be lost; all commits are checked in as if by the
invoking user and identified with the invoking user's login name.
-However, complete attribution is preserved in comment headers unless
-the -p option was selected.</para>
+(However, this tool preserves complete attribution in comment headers
+unless the -p option was selected.)</para>
+
+<para>Lightweight tags and branches may cause errors in older RCS versions,
+as they are saved with their full (path) names, including slashes.</para>
+
+<para>Submodule links ("M" entries mith mode 160000) can't be handled;
+the tool will throw an error if it sees one.</para>
+
+<para>The following are implementation limits of this tool which may be
+fixed in a future release :</para>
+
+<para>All annotated-tag metadata other than the tag name will be lost.</para>
-<para>All annotated-tag metadata other than its name will be lost.</para>
+<para>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.</para>
</refsect1>
<refsect1 id='returns'><title>ERROR RETURNS</title>