]> thyrsus.com Git - src.git/commitdiff
We can create and list tags.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 03:45:34 +0000 (22:45 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 7 Nov 2014 03:45:34 +0000 (22:45 -0500)
src

diff --git a/src b/src
index bcf248f7ff4913a668577571ada56a2f825e5649..56cd68ef19faa1364ddda34976426350e14a504c 100755 (executable)
--- 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))