# modtimes.
#
# This code uses magic tags with a 0 in the second-to-last slot to designate
-# branches. It's the same format as CVS sticky tags.
+# branches. It's the same format as CVS sticky tags, for the same reason.
+# They need to be distinguishable from regular tags pointing at revisions,
+# and this way the code to transform the sticky tag into the branch name is
+# as simple as possible.
#
# Top of the list of things that people will bikeshed about is the
# letter codes returned by src status. Different VCSes have
if item.revno == revno:
return item.revision
croak("{0} has no revno {1}".format(self.name, revno))
- def isbranch(self, symbol):
- "Is this a branch symbol?"
- return "0." in symbol
def help_method(*_args):
"Summarize src commands, or (with argument) show help for a single command."
croak("in {0}, can't resolve symbol {0}".format(metadata.name,token))
else:
part = metadata.symbols[part]
- if metadata.isbranch(part):
+ if backend.isbranch(part):
part = backend.branch_to_tip(part)
return metadata.native_to_revno(part)
croak("internal error: in %s, failed to resolve %s" % (metadata.name, token))
display = metadata.native_to_revno(display)
else:
display = metadata.native_to_revno(value)
- if metadata.isbranch(value) == (legend == "branch"):
+ if backend.isbranch(value) == (legend == "branch"):
sys.stdout.write("%4s\t%s\n" % (display,key))
return
if args[0] in ("-r", "rename"):
n = self.splitrev(rev)
n[-1] += 1
return self.joinrev(n)
+ def isbranch(self, symbol):
+ "Is this a branch symbol?"
+ return "0." in symbol
def branch_to_base(self, revid):
"Go from a branch ID sticky tag to the revision it was based on."
# Must return an emptry string for the fake root sticky tag.
# Undocumented fact about RCS: The branch "1" is
# the same as the blank branch. Significant because
# you can't reset to the blank branch using rcs -b,
- # that resets to the dynamically hhighest branch.
+ # that resets to the dynamically highest branch.
if not branch or branch == "1":
metadata.branch = "trunk"
elif line.startswith("----------------------------"):