s = GenericRev(self.rev)
s.rev[-1] += 1
return s
- def branch(self, branchnum):
- "Return ID for the tip of a new branch."
- return GenericRev(self.rev + [branchnum, 1])
+ def branch(self, branchnum=None):
+ "With arg, return ID for the tip of a new branch."
+ if branchnum is None:
+ return GenericRev(self.rev[:-1])
+ else:
+ return GenericRev(self.rev + [branchnum, 1])
def __str__(self):
return ".".join(map(str, self.rev))
comment = event.email_out()
else:
comment = event.comment
- do_or_die(self.checkin(commit, comment, op, path), legend)
+ rev = self.make_tip(commit, path)
+ do_or_die(self.checkin(commit, comment, op, path, rev), legend)
loud_remove(path)
+ if commit.is_tip():
+ self.maketag(commit.branch, str(rev.branch()), path)
def modify(self, event, path, mode, copyfile):
"Perform file checkins and modifications,"
sanecheck(event, path, mode, copyfile)
mastertemplate = "%s,v"
def __init__(self):
Generic.__init__(self)
- def checkin(self, commit, comment, op, path):
+ def checkin(self, commit, comment, op, path, rev):
"Check in a new revision - also used to create new masters."
- command = "ci -l%s" % self.make_tip(commit, path)
+ command = "ci -l%s" % rev
if op == "D":
command += " -sDeleted"
command += " -d'%s'" % commit.committer.date.rfc822()
def checkout(self, path, branch):
"Check out the latest revision corresponding to path and branch."
return "co -r%s %s" % (self.get_tip(path, branch), self.master(path))
+ def maketag(self, name, rev, path):
+ "Attach a tag to a file, overwriting any previous."
+ do_or_die("rcs -N'%s':%s %s" % (name, rev, self.master(path)))
def postcommit(self, event):
"Save annotated tags for round-tripping."
for tag in event.taglist: