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


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

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Branch:         
Changes by:     Derek Robert Price <address@hidden>     06/05/23 02:08:19

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

Log message:
        Merge changes from 1.11.x.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/ChangeLog.diff?tr1=1.3424&tr2=1.3425&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/rcs.c.diff?tr1=1.366&tr2=1.367&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/sanity.sh.diff?tr1=1.1141&tr2=1.1142&r1=text&r2=text

Patches:
Index: ccvs/src/ChangeLog
diff -u ccvs/src/ChangeLog:1.3424 ccvs/src/ChangeLog:1.3425
--- ccvs/src/ChangeLog:1.3424   Tue May 23 01:09:08 2006
+++ ccvs/src/ChangeLog  Tue May 23 02:08:18 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-22  Derek Price  <address@hidden>
Index: ccvs/src/rcs.c
diff -u ccvs/src/rcs.c:1.366 ccvs/src/rcs.c:1.367
--- ccvs/src/rcs.c:1.366        Fri May 12 17:12:46 2006
+++ ccvs/src/rcs.c      Tue May 23 02:08:19 2006
@@ -633,14 +633,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.  */
@@ -794,10 +789,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->print_path, key);
+                  "Delta text %s without revision information in `%s'.",
+                  key, rcs->print_path);
 
        vnode = vers->data;
 
@@ -4301,6 +4296,11 @@
        gothead = 0;
        if (! rcsbuf_getrevnum (&rcsbuf, &key))
            error (1, 0, "unexpected EOF reading %s", rcs->print_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"))
@@ -7676,6 +7676,13 @@
        if (! rcsbuf_getrevnum (rcsbuf, &key))
            error (1, 0, "unexpected EOF reading RCS file %s", rcs->print_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->print_path);
+
        if (next != NULL && ! STREQ (next, key))
        {
            /* This is not the next version we need.  It is a branch
@@ -7687,13 +7694,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->print_path, key);
-
            /* Stash the previous version.  */
            prev_vers = vers;
 
@@ -8183,9 +8183,10 @@
     }
 
     p = findnode (rcs->versions, num);
-    if (p == NULL)
-       error (1, 0, "mismatch in rcs file %s between deltas and deltatexts 
(%s)",
-              rcs->print_path, num);
+    if (!p)
+       error (1, 0,
+              "Delta text %s without revision information in `%s'.",
+              num, rcs->print_path);
 
     d = xmalloc (sizeof (Deltatext));
     d->version = xstrdup (num);
@@ -8599,6 +8600,11 @@
        }
 
        np = findnode (rcs->versions, dtext->version);
+       if (!np)
+           error (1, 0,
+                  "Delta text %s without revision information in `%s'.",
+                  dtext->version, rcs->print_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.1141 ccvs/src/sanity.sh:1.1142
--- ccvs/src/sanity.sh:1.1141   Tue May 23 01:09:08 2006
+++ ccvs/src/sanity.sh  Tue May 23 02:08:19 2006
@@ -23327,8 +23327,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 
@@ -23344,19 +23342,9 @@
          # Populate it.
          echo some words >afile
          dotest rcs6-init-3 "$testcvs -Q add afile"
-         dotest rcs6-init-4 "$testcvs -Q ci -mnewfile afile" \
-"RCS file: $CVSROOT_DIRNAME/rcs6/afile,v
-done
-Checking in afile;
-$CVSROOT_DIRNAME/rcs6/afile,v  <--  afile
-initial revision: 1\.1
-done"
+         dotest rcs6-init-4 "$testcvs -Q ci -mnewfile afile"
          echo more words >>afile
-         dotest rcs6-init-5 "$testcvs -Q ci -mrev2 afile" \
-"Checking in afile;
-$CVSROOT_DIRNAME/rcs6/afile,v  <--  afile
-new revision: 1\.2; previous revision: 1\.1
-done"
+         dotest rcs6-init-5 "$testcvs -Q ci -mrev2 afile"
 
          # Corrupt the archive.
          sed -e '8,12d' \
@@ -23364,36 +23352,19 @@
              <$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" \
-"$SPROG \[update aborted\]: invalid change text in 
$CVSROOT_DIRNAME/rcs6/cfile,v"
-
-         if $keep; then
-           echo Keeping $TESTDIR and exiting due to --keep
-           exit 0
-         fi
+         # Update used to work.
+         dotest_fail rcs6-1 "$testcvs -q up" \
+"$SPROG \[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.
 
+         dokeep
          cd ../../..
          rm -r rcs6
-         rm -rf $CVSROOT_DIRNAME/rcs6
+         modify_repo rm -rf $CVSROOT_DIRNAME/rcs6
          ;;
 
 




reply via email to

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