From: Eric S. Raymond Date: Fri, 7 Nov 2014 03:45:34 +0000 (-0500) Subject: We can create and list tags. X-Git-Tag: 0.1~6 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=bacd16cd0b887a697c7e2c3e187fcf3ecee83d47;p=src.git We can create and list tags. --- diff --git a/src b/src index bcf248f..56cd68e 100755 --- a/src +++ b/src @@ -126,7 +126,7 @@ class RCSLog: if not line[0].isspace(): if debug >= DEBUG_PARSE: sys.stdout.write("\t-> init\n") - state = "init" + state = "init" else: fields = line.strip().split() self.lockrevs.append(fields[1]) @@ -134,7 +134,7 @@ class RCSLog: if not line[0].isspace(): if debug >= DEBUG_PARSE: sys.stdout.write("\t-> init\n") - state = "init" + state = "init" else: fields = line.strip().split() name = fields[0] @@ -392,8 +392,16 @@ def diff_method(*args): # The || : suppresses the error return from diff(1) do_or_die("rcsdiff -q {0} {1} {2} || :".format(diffspec, diffopts, arg),loud=True) -def list_tags(args): - pass +def list_tags(*args): + (revspec, args) = preamble("tag", args) + if revspec is not None: + croak("can't accept a revision-spec when deleting tags.") + width = screenwidth() + for arg in args: + state = RCSLog(arg) + sys.stdout.write("= %s %s\n" % (arg, ((width - len(arg) - 5) * "="))) + for (key, value) in state.symbols.items(): + sys.stdout.write("%4d %s\n" % (state.rcs_to_revno(value),key)) def delete_tags(args): if not args: @@ -401,7 +409,7 @@ def delete_tags(args): tagname = args.pop(0) (revspec, args) = preamble("tag", args) if revspec is not None: - croak("can't accept a revision-spec when deletting tags.") + croak("can't accept a revision-spec when deleting tags.") for arg in args: with lifted(arg): do_or_die("rcs -n{0} {1}".format(tagname, arg))