From c5c800102b451cba2989d52c761f6c18ab1675f6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 13 Nov 2010 15:56:17 -0500 Subject: [PATCH] Still more code pushed to parent class. --- rcs-fast-import | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/rcs-fast-import b/rcs-fast-import index d9f56a7..65334ef 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -618,11 +618,19 @@ class Generic: def precommit(self, event): #self.record("commit") pass + def supercheckin(self, commit, path, legend, state=None): + "You knew the job was dangerous when you took it." + if self.roundtrip: + comment = event.email_out() + else: + comment = event.comment + self.checkin(commit, comment, path, legend, state=None) + loud_remove(path) def modify(self, event, path, mode, copyfile): "Perform RCS file checkins and modifications," self.sanecheck(event, path, mode, copyfile) self.instantiate(path, copyfile) - self.checkin(event, path, "modify") + self.supercheckin(event, path, "modify") #self.record("M", path) def copy(self, commit, source, target, legend="Copy"): "Perform RCS copies. Start the copy with no history." @@ -631,14 +639,14 @@ class Generic: self.checkout(commit, source, legend) self.instantiate(target) loud_rename(source, target) - self.checkin(commit, target, legend="copy") + self.supercheckin(commit, target, legend="copy") #self.record("C", source) #self.record("T", target) def delete(self, commit, path, legend="delete"): "Mark a path deleted, but don't actually remove the master." self.instantiate(path) open(path, "w").close() - self.checkin(commit, path, legend="delete", state="Deleted") + self.supercheckin(commit, path, legend="delete", state="Deleted") #self.record("D", path) class RCS(Generic): @@ -657,12 +665,8 @@ class RCS(Generic): def sanecheck(self, event, path, mode, copyfile): if mode == "160000": raise FatalException("ignoring a submodule link %s", path) - def checkin(self, commit, path, legend, state=None): + def checkin(self, commit, comment, path, legend, state=None): "Check in a new revision - also used to create new masters." - if self.roundtrip: - comment = event.email_out() - else: - comment = event.comment command = "ci -l" if state: command += " -s" + state @@ -670,7 +674,6 @@ class RCS(Generic): command += ' -m"%s"' % comment.replace('"', '\\"') command += " " + path + " " + self.master(path) do_or_die(command, legend) - loud_remove(path) def checkout(self, commit, source, legend): # FIXME: not presently adjusted for commit's branch do_or_die("co %s" % self.master(source), legend) -- 2.43.0