[Top][All Lists]

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

Two update bugs (with proposed fixes)

From: Edward Wang
Subject: Two update bugs (with proposed fixes)
Date: Thu, 4 Apr 2002 10:28:12 -0800

Hi.  I have tentative fixes for two bugs that have been
annoying us.

The first is that trailing slashes in the arguments to "cvs update"
confuse the server.  The reason is that the slashes cause
arg_should_not_be_sent_to_server() to return true, so the arguments
don't get sent to the server.  The easy fix is to call
strip_trailing_slashes() in update().  However, this doesn't
fix other commands (if any) with the same problem.  It might
be reasonable to change is_arg_a_parent_or_listed_dir()
to account for trailing slashes in the matching, but I'm
not sure what the effect of that is.  For example, is it
okay to send a directory name to the server with a trailing

I'm willing to investigate further if this is not a good fix.

The second is more subtle.  The symptom is that in an interbranch
merge like this
        cvs co -kk -rbranch-tag tree
        cvs up -kk -jtag1 -jtag2 tree
local (not client-server) CVS uses the existing files
in "tree" (along with checked-out copies with tag1 and tag2)
to do the merge, while the server must check out all three versions.
However, it calls RCS_checkout() for the branch-tag files
without the -kk option, so RCS keywords get expanded in the result.
This isn't so bad, except tag1 and tag2 files do get checked out
with -kk, and with 1.11.1p1 and earlier (before the diff3() changes),
the difference confuses diff3() and we sometimes get spurious
merge conflicts elsewhere in the file.

The fix is to pass vers->options instead of NULL to RCS_checkout()
in join_file().  I believe this is fully correct, since vers->options
comes from either the sticky option in Entries or the command line,
as appropriate.

By the way, I'm working on CVS as part of a reevaluation of CVS
for my company.  If we decide to stick with CVS, I will be
spending some more time on it, and I would like to look into
joining the CVS developer group in that case.

I also have a fix for "cvs add" with arguments with leading
directories.  I'll submit that separately.


Index: src/update.c
RCS file: /cvs/ccvs/src/update.c,v
retrieving revision 1.197
diff -u -r1.197 update.c
--- src/update.c        8 Jul 2001 20:51:46 -0000       1.197
+++ src/update.c        4 Apr 2002 17:30:51 -0000
@@ -139,6 +139,7 @@
     int c, err;
     int local = 0;                     /* recursive by default */
     int which;                         /* where to look for files and dirs */
+    int i;
     if (argc == -1)
        usage (update_usage);
@@ -233,6 +234,9 @@
     argc -= optind;
     argv += optind;
+    for (i = 0; i < argc; i++)
+       strip_trailing_slashes (argv[i]);
     if (current_parsed_root->isremote) 
@@ -2446,7 +2450,7 @@
        /* The file is up to date.  Need to check out the current contents.  */
        retcode = RCS_checkout (vers->srcfile, finfo->file,
                                vers->vn_user, (char *) NULL,
-                               (char *) NULL, RUN_TTY,
+                               vers->options, RUN_TTY,
                                (RCSCHECKOUTPROC) NULL, (void *) NULL);
        if (retcode != 0)
            error (1, 0,

reply via email to

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