From bacd16cd0b887a697c7e2c3e187fcf3ecee83d47 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 6 Nov 2014 22:45:34 -0500 Subject: [PATCH] We can create and list tags. --- src | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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)) -- 2.43.0