croak("{0} has no revno {1}".format(self.name, revno))
def isbranch(self, symbol):
"Is this a branch symbol?"
- return ".0." in symbol
+ return ".0" in symbol
def help_method(*args):
"Summarize src commands, or (with argument) show help for a single command."
if legend == "branch":
sys.stdout.write("%s\n" % metadata.branch)
for (key, value) in metadata.symbols.items():
- if legend == "branch" and key == branch.metadata:
+ if legend == "branch" and key == metadata.branch:
continue
- if metadata.isbranch(arg) == (legend == "branch"):
+ if metadata.isbranch(value) == (legend == "branch"):
sys.stdout.write("%4d\t%s\n" % (metadata.rcs_to_revno(value),key))
return
if args[0] in ("-r", "rename"):
sys.stderr.write("\t-> symbols\n")
state = "symbols"
elif line.startswith("branch:"):
- if not line.strip()[7:]:
+ branch = line.split(":")[1].strip()
+ if not branch:
metadata.branch = "trunk"
- else:
- croak("non-trunk branches are not yet supported.")
elif line.startswith("----------------------------"):
if debug >= DEBUG_PARSE:
sys.stderr.write("\t-> logheader\n")
break
elif metadata.revlist:
metadata.revlist[-1].log += line
+ # Now that we have the symbol table...
+ if metadata.branch != "trunk":
+ for (k, v) in metadata.symbols.items():
+ if v == metadata.branch:
+ metadata.branch = k
+ break
+ else:
+ croak("unrecognized branch ID '%s'" % branch)
for item in metadata.revlist:
item.revno = maxrevno - item.revno
if debug >= DEBUG_PARSE: