cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/src ChangeLog rcs.c sanity.sh [cvs1-11-x-branch]


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog rcs.c sanity.sh [cvs1-11-x-branch]
Date: Tue, 23 May 2006 02:02:40 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Branch:         cvs1-11-x-branch
Changes by:     Derek Robert Price <address@hidden>     06/05/23 02:02:38

Modified files:
        src            : ChangeLog rcs.c sanity.sh 

Log message:
        * rcs.c (RCS_reparsercsfile, RCS_fully_parse, RCS_checkout, RCS_deltas,
        RCS_getdeltatext, RCS_copydeltas): Verify input revision numbers.
        (rcs6): Update to compensate.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/ChangeLog.diff?only_with_tag=cvs1-11-x-branch&tr1=1.2336.2.449&tr2=1.2336.2.450&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/rcs.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.262.4.52&tr2=1.262.4.53&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/sanity.sh.diff?only_with_tag=cvs1-11-x-branch&tr1=1.752.2.195&tr2=1.752.2.196&r1=text&r2=text

Patches:
Index: ccvs/src/ChangeLog
diff -u ccvs/src/ChangeLog:1.2336.2.449 ccvs/src/ChangeLog:1.2336.2.450
--- ccvs/src/ChangeLog:1.2336.2.449     Tue May 23 01:04:06 2006
+++ ccvs/src/ChangeLog  Tue May 23 02:02:36 2006
@@ -1,5 +1,9 @@
 2006-05-22  Derek Price  <address@hidden>
 
+       * rcs.c (RCS_reparsercsfile, RCS_fully_parse, RCS_checkout, RCS_deltas,
+       RCS_getdeltatext, RCS_copydeltas): Verify input revision numbers.
+       (rcs6): Update to compensate.
+
        * sanity.sh (rcs6): New test.
 
 2006-05-16  Derek Price  <address@hidden>
Index: ccvs/src/rcs.c
diff -u ccvs/src/rcs.c:1.262.4.52 ccvs/src/rcs.c:1.262.4.53
--- ccvs/src/rcs.c:1.262.4.52   Fri May 12 15:17:38 2006
+++ ccvs/src/rcs.c      Tue May 23 02:02:36 2006
@@ -616,14 +616,9 @@
        q->key = vnode->version;
 
        /* add the nodes to the list */
-       if (addnode (rdata->versions, q) != 0)
-       {
-#if 0
-               purify_printf("WARNING: Adding duplicate version: %s (%s)\n",
-                        q->key, rcsfile);
-               freenode (q);
-#endif
-       }
+       if (addnode (rdata->versions, q))
+           error (1, 0, "Multiple %s revision deltas found in `%s'",
+                  q->key, rcsfile);
     }
 
     /* Here KEY and VALUE are whatever caused getdelta to return NULL.  */
@@ -777,10 +772,10 @@
            break;
 
        vers = findnode (rcs->versions, key);
-       if (vers == NULL)
+       if (!vers)
            error (1, 0,
-                  "mismatch in rcs file %s between deltas and deltatexts (%s)",
-                  rcs->path, key);
+                  "Delta text %s without revision information in `%s'.",
+                  key, rcs->path);
 
        vnode = vers->data;
 
@@ -4239,6 +4234,11 @@
        gothead = 0;
        if (! rcsbuf_getrevnum (&rcsbuf, &key))
            error (1, 0, "unexpected EOF reading %s", rcs->path);
+
+       if (!STREQ (rcs->head, key))
+           error (1, 0, "Expected head revision %s, found %s.",
+                  rcs->head, key);
+
        while (rcsbuf_getkey (&rcsbuf, &key, &value))
        {
            if (STREQ (key, "log"))
@@ -7388,6 +7388,13 @@
        if (! rcsbuf_getrevnum (rcsbuf, &key))
            error (1, 0, "unexpected EOF reading RCS file %s", rcs->path);
 
+       /* look up the revision */
+       node = findnode (rcs->versions, key);
+       if (!node)
+           error (1, 0,
+                  "Delta text %s without revision information in `%s'.",
+                  key, rcs->path);
+
        if (next != NULL && ! STREQ (next, key))
        {
            /* This is not the next version we need.  It is a branch
@@ -7399,13 +7406,6 @@
        {
            isnext = 1;
 
-           /* look up the revision */
-           node = findnode (rcs->versions, key);
-           if (node == NULL)
-               error (1, 0,
-                      "mismatch in rcs file %s between deltas and deltatexts 
(%s)",
-                      rcs->path, key);
-
            /* Stash the previous version.  */
            prev_vers = vers;
 
@@ -7906,9 +7906,10 @@
     }
 
     p = findnode (rcs->versions, num);
-    if (p == NULL)
-       error (1, 0, "mismatch in rcs file %s between deltas and deltatexts 
(%s)",
-              rcs->path, num);
+    if (!p)
+       error (1, 0,
+              "Delta text %s without revision information in `%s'.",
+              num, rcs->path);
 
     d = (Deltatext *) xmalloc (sizeof (Deltatext));
     d->version = xstrdup (num);
@@ -8336,6 +8337,11 @@
        }
 
        np = findnode (rcs->versions, dtext->version);
+       if (!np)
+           error (1, 0,
+                  "Delta text %s without revision information in `%s'.",
+                  dtext->version, rcs->path);
+
        dadmin = np->data;
 
        /* If this revision has been outdated, just skip it. */
Index: ccvs/src/sanity.sh
diff -u ccvs/src/sanity.sh:1.752.2.195 ccvs/src/sanity.sh:1.752.2.196
--- ccvs/src/sanity.sh:1.752.2.195      Tue May 23 01:04:57 2006
+++ ccvs/src/sanity.sh  Tue May 23 02:02:36 2006
@@ -20628,8 +20628,6 @@
 
 
        rcs6)
-         # FIXCVS - The following comment should apply after this is fixed:
-         #
          # Test that CVS notices a specific type of corruption in the RCS
          # archive.  In the past, this type of corruption had turned up after
          # a user ineptly attempted to delete a revision from an arcvhive 
@@ -20665,27 +20663,14 @@
              <$CVSROOT_DIRNAME/rcs6/afile,v \
              >$CVSROOT_DIRNAME/rcs6/cfile,v
 
-         # These worked.
-         dotest rcs6-1 "$testcvs -q up" \
-"U cfile"
-         dotest rcs6-2 "$testcvs -q tag current" \
-"T afile
-T cfile"
-
-         # This hosed the archive further without any warnings.
-         echo even more words >>cfile
-         dotest rcs6-3 "$testcvs ci -mhose-it cfile" \
-"Checking in cfile;
-$CVSROOT_DIRNAME/rcs6/cfile,v  <--  cfile
-new revision: 1\.2; previous revision: 1\.1
-done"
-
-         # Can still tag.
-         dotest rcs6-4 "$testcvs -q tag -F current" "T cfile"
-
-         # This finally reports the corruption.
-         dotest_fail rcs6-5 "$testcvs -q up -r1.1 cfile" \
-"$PROG \[update aborted\]: invalid change text in 
$CVSROOT_DIRNAME/rcs6/cfile,v"
+         # Update used to work.
+         dotest_fail rcs6-1 "$testcvs -q up" \
+"$PROG \[update aborted\]: Expected head revision 1\.1, found 1\.2\."
+
+         # Then a commit hosed the archive further without any warnings.
+         # Updating to an old revision (e.g. 1.1) would have reported the
+         # corruption.  A second commit would have deleted data from the
+         # file.
 
          if $keep; then
            echo Keeping $TESTDIR and exiting due to --keep




reply via email to

[Prev in Thread] Current Thread [Next in Thread]