]> thyrsus.com Git - src.git/commitdiff
NEWS and test suite polishing.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 8 Nov 2014 05:37:16 +0000 (00:37 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 8 Nov 2014 05:37:16 +0000 (00:37 -0500)
NEWS
src
srctest

diff --git a/NEWS b/NEWS
index 565d41140149ea4bacd8dd9a6be5c980c8fbb21a..adbf880c11038caf25bb1f307fcd89f737fbbceb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,9 +2,10 @@
 
 Repository head:
    There is a public repository on Gitorious
+   All the initially projected commands except branch are impplemented.
    The bug that caused filures with vi has been fixed.
    ".." is a legal range separator as well as "-".
-   More documentation.
+   There is a regression-test suite, and more documentation.
 
 0.1: 2014-11-07
    Initial proof-of-concept release.
diff --git a/src b/src
index d747b2565ce4cf872d9b7fc092a19090c853bf35..295758f2c9fda70aba20d4808a84248918fa861a 100755 (executable)
--- a/src
+++ b/src
@@ -112,12 +112,17 @@ class RCSRevisionItem:
         except TypeError, ValueError:
             croak("garbled date %s" % self.date)
 
+def master(arg):
+    return os.path.join(repodir, arg + ",v")
+
 class RCSLog:
     "Encapsulate a revision list and some methods on it"
     def __init__(self, name):
         self.name = name
         self.revlist = []
         self.symbols = {}
+        if not os.path.exists(master(self.name)):
+            croak("%s is not registered" % self.name)
         with popen_or_die("cd %s >/dev/null; rlog %s 2>/dev/null; cd ..>/dev/null" % (repodir, name)) as fp:
             self.revlist = []
             self.lockrevs = []
@@ -365,7 +370,7 @@ def add_method(*args):
     for arg in args:
        if not os.path.exists(arg):
            croak("I see no '%s' here." % arg)
-       elif os.path.exists("%s/%s,v" % (repodir, arg)):
+       elif os.path.exists(master(arg)):
            croak("%s is already registered." % arg)
        else:
            do_or_die("rcs -q -kb -i {0} </dev/null && mv {0},v {1}".format(arg, repodir))
@@ -414,7 +419,7 @@ def commit_method(*args):
     for arg in args:
        if not os.path.exists(arg):
            croak("I see no '%s' here." % arg)
-       elif not os.path.exists("%s/%s,v" % (repodir, arg)):
+       elif not os.path.exists(master(arg)):
            croak("%s is not registered." % arg)
        else:
            if not comment:
@@ -533,8 +538,12 @@ def delete_tags(args):
     if revspec is not None:
         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))
+        master = RCSLog(arg)
+        if tagname not in master.symbols:
+            croak("%s is not a tag in %s" % (tagname, arg))
+        else:
+            with lifted(arg):
+                do_or_die("rcs -n{0} {1}".format(tagname, arg))
 
 def set_tags(args):
     if not args:
diff --git a/srctest b/srctest
index 2911fee7531bf5f5e4cbd13c01d522287e7b715b..d98d624f32bd142923114b512319aeae607f25c0 100755 (executable)
--- a/srctest
+++ b/srctest
@@ -151,6 +151,6 @@ src $TESTOPTS tag >testfile13
 diff testfile12 testfile13
 check "tag list check after deletion"
 
-# to do: tag, fast-export
+# to do: fast-export
 
 # end