[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
join command, keyword expansion, sticky options: bug and fix (correction
From: |
Ken . Olstad |
Subject: |
join command, keyword expansion, sticky options: bug and fix (correction) |
Date: |
Wed, 20 Mar 2002 10:42:17 -0600 |
Hello again, CVS maintainers,
I submitted a bug report and a fix yesterday to bug-cvs, and just now
noticed that I screwed up the report. If you wasted time trying to make
sense of the terminal transcript I pasted in to show the problem, please
accept my apology. Below is the report again, this time with a new,
correct transcript.
Ken Olstad
-------------------
Given a text file foo in CVS with default keyword substitution set in
the repository (i.e. "cvs log -h foo" shows "keyword substitution: kv"),
but with -kk turned on in my sandbox (via "cvs update -kk f1", so
that the working file doesn't have keyword values, and "cvs status foo"
shows sticky option -kk), I was surprised to find that the join command
cvs update -jA -jB f1
leaves RCS keywords (e.g. $Revision$) with values expanded in the
working file. That is, somewhere along the way, the merge command
ignores the "-kk" from the CVS/Entries entry. This is a problem in case
the contents of revision B are the same as the contents of the BASE
revision of file f1 (except for keyword values), because in this case,
f1 becomes Locally Modified, so that a blanket commit will checkin a new
revision of foo, even though there is no change.
Below is a patch, against the tip of the trunk as of this morning, that
fixes this. I don't feel I know the code or the test suite well enough
to be confident that I didn't break something, but it fixes the problem
and doesn't cause any 'make check' failures.
$ cvs diff -u
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 19 Mar 2002 16:59:30 -0000
@@ -2446,7 +2446,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,
I didn't take the time to figure out how to add a case for this to the
automated test script, but here is a transcript of a session that shows
the pre- and post-fix behavior. I believe the problem only shows up in
client-server operation.
$ echo $CVSROOT # client/server
:fork:/home/keno/test-repository
$ cvs -qf get src/f1
U src/f1
$ cd src
$ cvs st f1
===================================================================
File: f1 Status: Up-to-date
Working revision: 1.2
Repository revision: 1.2 /home/keno/test-repository/src/f1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
$ cvs -qf log -h f1 |grep keyword # f1 has the default substitution
setting
keyword substitution: kv
$ grep Revision f1
$Revision: 1.2 $
$ cvs -qf up -kk f1 # set sticky option locally
U f1
$ cvs -fq st f1
===================================================================
File: f1 Status: Up-to-date
Working revision: 1.2
Repository revision: 1.2 /home/keno/test-repository/src/f1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kk
$ grep Revision f1
$Revision$
$ cvs -qf diff -kk -r1.1.2.1 f1 # source and target content are the
same
Index: f1
===================================================================
RCS file: /home/keno/test-repository/src/f1,v
retrieving revision 1.1.2.1
retrieving revision 1.2
diff -r1.1.2.1 -r1.2
$ # cq is an alias for the unmodified trunk build of the cvs executable
$ c1 -qf up -j1.1 -j1.1.2.1 f1
RCS file: /home/keno/test-repository/src/f1,v
retrieving revision 1.1
retrieving revision 1.1.2.1
Merging differences between 1.1 and 1.1.2.1 into f1
$ cvs -qf st f1 # Should be Up-to-date, but:
===================================================================
File: f1 Status: Locally Modified
Working revision: 1.2
Repository revision: 1.2 /home/keno/test-repository/src/f1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kk
$ cvs -qf diff f1 # The difference is only in keyword
substitution
Index: f1
===================================================================
RCS file: /home/keno/test-repository/src/f1,v
retrieving revision 1.2
diff -r1.2 f1
1c1
< $Revision$
---
> $Revision: 1.2 $
$ # Clean up and redo the merge with the fixed cvs (alias c2).
$ rm -f f1
$ cvs up -kk f1
U f1
$ c2 -qf up -j1.1 -j1.1.2.1 f1
RCS file: /home/keno/test-repository/src/f1,v
retrieving revision 1.1
retrieving revision 1.1.2.1
Merging differences between 1.1 and 1.1.2.1 into f1
$ cvs -qf st f1
===================================================================
File: f1 Status: Up-to-date
Working revision: 1.2
Repository revision: 1.2 /home/keno/test-repository/src/f1,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kk
$ grep Revision f1
$Revision$
$
I hope this helps. I welcome your comments, especially if there's
something wrong with the fix.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- join command, keyword expansion, sticky options: bug and fix (correction),
Ken . Olstad <=