def precommit(self, event):
#self.record("commit")
pass
+ 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.record("M", path)
+ def copy(self, commit, source, target, legend="Copy"):
+ "Perform RCS copies. Start the copy with no history."
+ if os.path.exists(self.master(target)):
+ raise FatalException("copy to existing file")
+ self.checkout(commit, source, legend)
+ self.instantiate(target)
+ loud_rename(source, target)
+ self.checkin(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)
value = value[:-1]
return value
raise FatalException("missing '%s' in %s" % (header, master))
+ 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):
"Check in a new revision - also used to create new masters."
if self.roundtrip:
command += " " + path + " " + self.master(path)
do_or_die(command, legend)
loud_remove(path)
- def modify(self, event, path, mode, copyfile):
- "Perform RCS file checkins and modifications,"
- if mode == "160000":
- raise FatalException("ignoring a submodule link %s", path)
- else:
- self.instantiate(path, copyfile)
- self.checkin(event, path, "modify")
- #self.record("M", path)
- def copy(self, commit, source, target, legend="Copy"):
- "Perform RCS copies. Start the copy with no history."
- if os.path.exists(self.master(target)):
- raise FatalException("copy to existing file")
+ def checkout(self, commit, source, legend):
+ # FIXME: not presently adjusted for commit's branch
do_or_die("co %s" % self.master(source), legend)
- self.instantiate(target)
- loud_rename(source, target)
- self.checkin(commit, target, legend="copy")
- #self.record("C", source)
- #self.record("T", target)
def postcommit(self, event):
# Save annotated tags for round-tripping
for tag in event.taglist:
% (tag.name, tag.tagger.date.rfc822()))
os.remove("ANNOTATED-TAGS")
do_or_die("rcs -n'%s': %s" % (tag.name, " ".join(self.masterfiles())))
- def checkout(self, switch):
+ def postactions(self, switch):
"Post-conversion actions."
if switch != '-l':
do_or_die("rcs -u %s" % (" ".join(self.masterfiles()),))
os.chdir(here)
finally:
nuke(tempdir, "cleaning up")
- vcs.checkout(checkout_mode)
+ vcs.postactions(checkout_mode)
raise SystemExit, 0
except FatalException, e:
complain(e.msg)