def define_revision(self, revision, date, author, state, branches, next): self.saw_revision = True if self.perfect_match: return tag = self.find_tag rev = Revision(revision, date, author, state == "dead") rev.lockinfo = self.lockinfo.get(revision) # perfect match if revision number matches tag number or if # revision is on trunk and tag points to trunk. imperfect match # if tag refers to a branch and either a) this revision is the # highest revision so far found on that branch, or b) this # revision is the branchpoint. perfect = (rev.number == tag.number) or (not tag.number and len(rev.number) == 2) if perfect or ( tag.is_branch and ( (tag.number == rev.number[:-1] and (not self.matching_rev or rev.number > self.matching_rev.number)) or (rev.number == tag.number[:-1]) ) ): self.matching_rev = rev self.perfect_match = perfect
def set_revision_info(self, revision, log, text): tag = self.find_tag rev = Revision(revision) if rev.number == tag.number: self.log = log depth = len(rev.number) if rev.number == self.head.number: assert self.sstext is None self.sstext = StreamText(text) elif (depth == 2 and tag.number and rev.number >= tag.number[:depth]): assert len(self.last.number) == 2 assert rev.number < self.last.number self.sstext.command(text) elif (depth > 2 and rev.number[:depth - 1] == tag.number[:depth - 1] and (rev.number <= tag.number or len(tag.number) == depth - 1)): assert len(rev.number) - len(self.last.number) in (0, 2) assert rev.number > self.last.number self.sstext.command(text) else: rev = None if rev: #print "tag =", tag.number, "rev =", rev.number, "<br>" self.last = rev
def define_revision(self, revision, date, author, state, branches, next): if self.perfect_match: return tag = self.find_tag rev = Revision(revision, date, author, state == "dead") rev.lockinfo = self.lockinfo.get(revision) # perfect match if revision number matches tag number or if revision is on # trunk and tag points to trunk. imperfect match if tag refers to a branch # and this revision is the highest revision so far found on that branch perfect = ((rev.number == tag.number) or (not tag.number and len(rev.number) == 2)) if perfect or (tag.is_branch and tag.number == rev.number[:-1] and (not self.matching_rev or rev.number > self.matching_rev.number)): self.matching_rev = rev self.perfect_match = perfect
def set_head_revision(self, revision): self.head = Revision(revision) self.last = None self.sstext = None
def define_revision(self, revision, date, author, state, branches, next): # check !revs.has_key(revision) self.revs[revision] = Revision(revision, date, author, state == "dead")