]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Still more code pushed to parent class.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 13 Nov 2010 20:56:17 +0000 (15:56 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 13 Nov 2010 20:56:17 +0000 (15:56 -0500)
rcs-fast-import

index d9f56a77f75971a9dcb419fc5c1b13bc531e5b4f..65334ef11209ee6c608ee740f354d70179bb9fd9 100755 (executable)
@@ -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)