bug-cvs
[Top][All Lists]
Advanced

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

Re: [Cvs-cvs] ccvs/src ChangeLog client.c sanity.sh update.c


From: Derek R. Price
Subject: Re: [Cvs-cvs] ccvs/src ChangeLog client.c sanity.sh update.c
Date: Wed, 16 Nov 2005 10:56:15 -0500
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Larry Jones wrote:

> I'd like you to reconsider only printing patch failure/refetching
> messages when tracing.  That's not supposed to happen, so if it does, it
> indicates that something is seriously wrong -- I think we should let the
> user know so that the cause of the failure can be fixed.

Okay.  How's the attached patch look?  It also adds a warning in two
patch-failed cases which cause refetches but not, previously, warnings.

Regards,

Derek
-- 
Derek R. Price
CVS Solutions Architect
Ximbiot <http://ximbiot.com>
v: +1 717.579.6168
f: +1 717.234.3125
<address@hidden>
Index: src/client.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/client.c,v
retrieving revision 1.435
diff -u -p -r1.435 client.c
--- src/client.c        16 Nov 2005 03:42:30 -0000      1.435
+++ src/client.c        16 Nov 2005 15:53:14 -0000
@@ -1646,6 +1646,9 @@ update_entries (void *data_arg, List *en
               or not based on whether the server supports "Rcs-diff".  
 
               Fall back to transmitting entire files.  */
+           error (0, 0,
+                  "unsupported patch format received for `%s'; will refetch",
+                  short_pathname);
            patch_failed = 1;
        }
        else
@@ -1674,7 +1677,11 @@ update_entries (void *data_arg, List *en
 
            if (! rcs_change_text (short_pathname, filebuf, nread, buf, size,
                                   &patchedbuf, &patchedlen))
+           {
+               error (0, 0, "patch failed for `%s'; will refetch",
+                      short_pathname);
                patch_failed = 1;
+           }
            else
            {
                if (stored_checksum_valid)
@@ -1687,7 +1694,7 @@ update_entries (void *data_arg, List *en
                    md5_buffer (patchedbuf, patchedlen, checksum);
                    if (memcmp (checksum, stored_checksum, 16) != 0)
                    {
-                       TRACE (TRACE_FUNCTION,
+                       error (0, 0,
 "checksum failure after patch to `%s'; will refetch",
                               short_pathname);
 
@@ -1758,8 +1765,8 @@ update_entries (void *data_arg, List *en
                    error (1, 0, "checksum failure on %s",
                           short_pathname);
 
-               TRACE (TRACE_FUNCTION,
-                      "checksum failure after patch to %s; will refetch",
+               error (0, 0,
+                      "checksum failure after patch to `%s'; will refetch",
                       short_pathname);
 
                patch_failed = 1;
Index: src/sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.1102
diff -u -p -r1.1102 sanity.sh
--- src/sanity.sh       16 Nov 2005 03:42:30 -0000      1.1102
+++ src/sanity.sh       16 Nov 2005 15:53:23 -0000
@@ -20563,7 +20563,10 @@ new revision: 1\.2; previous revision: 1
          # Now update the second copy.  When using remote CVS, the
          # patch will fail, forcing the file to be refetched.
          cd ../../2/first-dir
-         dotest serverpatch-8 "$testcvs -q update" 'U file1'
+         dotest serverpatch-8 "$testcvs -q update" 'U file1' \
+"$CPROG update: checksum failure after patch to \`\./file1'; will refetch
+$CPROG client: refetching unpatchable files
+U file1"
 
          dokeep
          cd ../..
@@ -24782,12 +24785,23 @@ new revision: 1\.3; previous revision: 1
          # associated with the current base version of the file in the
          # sandbox is not available in these cases.  See the note in the
          # patch_file function in update.c.
-         dotest keyword-21 "$testcvs -q update -r tag1" "U file1"
+         dotest keyword-21 "${testcvs} -q update -r tag1" "U file1" \
+"$CPROG update: checksum failure after patch to \`\./file1'; will refetch
+$CPROG client: refetching unpatchable files
+U file1"
 
          dotest keyword-22 "cat file1" '\$'"Name: tag1 "'\$'
 
-         # Like serverpatch-8, a patch is refetched here.
-         dotest keyword-23 "$testcvs update -A file1" "U file1"
+         if $remote; then
+           # Like serverpatch-8.  Not sure there is anything much we
+           # can or should do about this.
+           dotest keyword-23r "${testcvs} update -A file1" \
+"$CPROG update: checksum failure after patch to \`\./file1'; will refetch
+$CPROG client: refetching unpatchable files
+U file1"
+         else
+           dotest keyword-23 "${testcvs} update -A file1" "U file1"
+         fi
          dotest keyword-24 "cat file1" '\$'"Name:  "'\$'"
 change"
 
@@ -25139,7 +25153,10 @@ new revision: 1\.4; previous revision: 1
          # An update -kk or -A will unsub and sub keywords without updates
          # being required.
          # FIXCVS - see note above keyword-21
-         dotest keywordname-update-1 "$testcvs -q up -rbr" "U file1"
+         dotest keywordname-update-1 "${testcvs} -q up -rbr" "U file1" \
+"$CPROG update: checksum failure after patch to \`\./file1'; will refetch
+$CPROG client: refetching unpatchable files
+U file1"
          dotest keywordname-update-2 "cat file1" '\$'"Name: br "'\$'
          dotest keywordname-update-3 "cat file2" '\$'"Name:  "'\$'
 
@@ -25149,7 +25166,10 @@ new revision: 1\.4; previous revision: 1
 "T file1
 T file2"
          # FIXCVS - see note above keyword-21
-         dotest keywordname-update-5 "$testcvs -q up -A" "U file1"
+         dotest keywordname-update-5 "${testcvs} -q up -A" "U file1" \
+"$CPROG update: checksum failure after patch to \`\./file1'; will refetch
+$CPROG client: refetching unpatchable files
+U file1"
          dotest keywordname-update-6 "cat file1" \
 '\$'"Name:  "'\$'"
 new data"
@@ -25157,12 +25177,18 @@ new data"
 
          # But updating to a static tag does cause a substitution
          # FIXCVS - see same note above
-         dotest keywordname-update-8 "$testcvs -q up -rfirsttag" "U file1"
+         dotest keywordname-update-8 "${testcvs} -q up -rfirsttag" "U file1" \
+"$CPROG update: checksum failure after patch to \`\./file1'; will refetch
+$CPROG client: refetching unpatchable files
+U file1"
          dotest keywordname-update-9 "cat file1" '\$'"Name: firsttag "'\$'
          dotest keywordname-update-10 "cat file2" '\$'"Name:  "'\$'
 
          # And reverify the trunk update when the change is actually removed.
-         dotest keywordname-update-11 "$testcvs -q up -A" "U file1"
+         dotest keywordname-update-11 "${testcvs} -q up -A" "U file1" \
+"$CPROG update: checksum failure after patch to \`./file1'; will refetch
+$CPROG client: refetching unpatchable files
+U file1"
          dotest keywordname-update-12 "cat file1" \
 '\$'"Name:  "'\$'"
 new data"
Index: src/update.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/update.c,v
retrieving revision 1.257
diff -u -p -r1.257 update.c
--- src/update.c        16 Nov 2005 03:42:30 -0000      1.257
+++ src/update.c        16 Nov 2005 15:53:24 -0000
@@ -325,7 +325,8 @@ update (int argc, char **argv)
            }
            else
            {
-               TRACE (TRACE_FUNCTION, "refetching unpatchable files\n");
+               fprintf (stderr, "%s client: refetching unpatchable files\n",
+                        program_name);
 
                if (toplevel_wd != NULL
                    && CVS_CHDIR (toplevel_wd) < 0)

reply via email to

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