# FIXME: Someday, do real branch structure here.
if event.is_tip():
do_or_die("rcs -n'%s': %s" % (event.branch, " ".join(RCS.rcsfiles())))
- def delete(self, commit, path):
- "Mark a path deleted."
+ def delete(self, commit, path, legend="Delete"):
+ "Mark a path deleted, but don't actually remove the master."
file(path, "w").close()
- if roundtrip:
- comment = event.email_out()
- else:
- comment = event.comment
command = "ci -l"
- command += " -sDeleted"
+ command += " -s" + legend
command += " -d'%s'" % event.committer.date.rfc822()
- command += ' -m"%s"' % comment.replace('"', '\\"')
+ command += ' -m"%s of %s"' % (legend, path)
command += " " + path + " " + RCS.master(path)
+ do_or_die(command, legend.lower())
os.remove(path)
- def rename(self, source, target):
- "Perform RCS renames."
- # Dodgy, but since user is more likely to be
- # interested in later versions this is better
- # than doing nothing.
- os.rename(RCS.master(op.source), RCS.master(op.target))
def copy(self, source, target):
- "Perform RCS copies. Start the copy with no history"
+ "Perform RCS copies. Start the copy with no history."
uphere = os.path.basename(target)
do_or_die("co %s" % RCS.master(source), "copy checkout")
os.rename(source, here)
do_or_die("ci -i -m'Copy of %s' -l %s %s"
- % (source, uphere, RCS.master(target)))
+ % (source, uphere, RCS.master(target)),
+ "copy")
os.remove(uphere)
+ def rename(self, commit, source, target):
+ "Perform RCS renames, carrying history with the rename."
+ shutil.copy(RCS.master(op.source), RCS.master(op.target))
+ # History is *not* removed from the source
+ self.delete(commit, source, legend="Rename")
def checkout(self, switch):
"Post-conversion actions."
if switch != '-l':
if verbose:
announce("%5s R '%s' '%s'" % (event.mark, op.source, op.target))
if not dryrun:
- vcs.rename(op.source, op.target)
+ vcs.rename(event, op.source, op.target)
elif op.op == "C":
if verbose:
announce("%5s C '%s' '%s'" % (event.mark, op.source, op.target))