Tag: cvs1-11-x-branch
User: scjones
Date: 05/06/22 11:56:14
Modified:
/ccvs/src/
ChangeLog, sanity.sh, vers_ts.c
Log:
Merge keyword expansion changes from trunk.
File Changes:
Directory: /ccvs/src/
=====================
File [changed]: ChangeLog
Url:
https://ccvs.cvshome.org/source/browse/ccvs/src/ChangeLog?r1=1.2336.2.380&r2=1.2336.2.381
Delta lines: +7 -0
-------------------
--- ChangeLog 6 Jun 2005 21:32:50 -0000 1.2336.2.380
+++ ChangeLog 22 Jun 2005 18:56:01 -0000 1.2336.2.381
@@ -1,3 +1,10 @@
+2005-06-22 Larry Jones <lawrence.jones@xxxxxxx>
+
+ * vers_ts (Version_TS): Don't allow command line keyword expansion
+ modes to override binary mode.
+ * sanity.sh (): Tests for the above.
+ (Merged from trunk.)
+
2005-06-06 Conrad T. Pino <Conrad@xxxxxxxx>
* cvs.h: Reverse patch committed 2005-05-27 by Conrad T. Pino.
File [changed]: sanity.sh
Url:
https://ccvs.cvshome.org/source/browse/ccvs/src/sanity.sh?r1=1.752.2.175&r2=1.752.2.176
Delta lines: +48 -14
---------------------
--- sanity.sh 2 Jun 2005 16:48:20 -0000 1.752.2.175
+++ sanity.sh 22 Jun 2005 18:56:02 -0000 1.752.2.176
@@ -16404,6 +16404,24 @@
Sticky Date: (none)
Sticky Options: -kb"
+ # Test that "-kk" does not override "-kb"
+ cd ../..
+ mkdir 2a; cd 2a
+ dotest binfiles-5.5a0 "${testcvs} -q co -kk first-dir" 'U
first-dir/binfile'
+ cd first-dir
+ # Testing that sticky options is -kb is the closest thing we have
+ # to testing that binary files work right on non-unix machines
+ # (until there is automated testing for such machines, of course).
+ dotest binfiles-5.5a1 "${testcvs} status binfile" \
+"===================================================================
+File: binfile Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: -kb"
+
# Test whether the default options from the RCS file are
# also used when operating on files instead of whole
# directories
@@ -16423,6 +16441,22 @@
Sticky Options: -kb"
cd ../..
rm -r 3
+ # test that "-kk" does not override "-kb"
+ mkdir 3; cd 3
+ dotest binfiles-5.5c0 "${testcvs} -q co -kk first-dir/binfile" \
+'U first-dir/binfile'
+ cd first-dir
+ dotest binfiles-5.5c1 "${testcvs} status binfile" \
+"===================================================================
+File: binfile Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: -kb"
+ cd ../..
+ rm -r 3
cd 2/first-dir
cp ../../1/binfile2.dat binfile
@@ -16463,9 +16497,11 @@
dotest binfiles-con5 "${testcvs} -q update" '[UP] binfile'
dotest binfiles-9 "${testcvs} -q update -A" ''
- dotest binfiles-10 "${testcvs} -q update -kk" '[UP] binfile'
+ # "-kk" no longer does anything with "-kb"
+ dotest binfiles-10 "${testcvs} -q update -kk" ''
dotest binfiles-11 "${testcvs} -q update" ''
- dotest binfiles-12 "${testcvs} -q update -A" '[UP] binfile'
+ # "-kk" no longer does anything with "-kb"
+ dotest binfiles-12 "${testcvs} -q update -A" ''
dotest binfiles-13 "${testcvs} -q update -A" ''
cd ../..
@@ -22686,8 +22722,7 @@
# Here's the problem... shouldn't -kk a binary file...
rm file1
dotest keyword2-13 "${testcvs} -q update -A -kk -j branch" \
-"U binfile\.dat
-${PROG} update: warning: file1 was lost
+"${PROG} update: warning: file1 was lost
U file1
RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
@@ -22702,13 +22737,13 @@
new revision: 1\.3; previous revision: 1\.2
done"
- dotest_fail keyword2-15 "cmp binfile.dat ../binfile.dat" \
-"binfile\.dat \.\./binfile\.dat differ: char 13, line 2"
+ # "-kk" no longer corrupts binary files
+ dotest keyword2-15 "cmp binfile.dat ../binfile.dat" ''
# Okay, restore everything and make CVS try and merge a binary file...
+ # "-kk" no longer affects binary files
dotest keyword2-16 "${testcvs} -q update -A" \
-"[UP] binfile.dat
-[UP] file1"
+"[UP] file1"
dotest keyword2-17 "${testcvs} -q tag -b branch2" \
"T binfile\.dat
T file1"
@@ -22721,16 +22756,15 @@
${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
new revision: 1\.1\.4\.1; previous revision: 1\.1
done"
+ # "-kk" no longer affects binary files
+
+ # XXXX: do not ask, why we get the "U binfile.dat" line twice
+ # looks like a bug!
dotest keyword2-20 "${testcvs} -q update -A -kk -j branch2" \
"U binfile\.dat
-RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v
-
-
-Merging differences between 1\.1 and 1\.1\.4\.1 into binfile\.dat
+U binfile\.dat
U file1"
- # Yep, it's broke, 'cept for that gal in Hodunk who uses -kk
- # so that some files only merge when she says so. Time to clean up...
cd ../..
rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
File [changed]: vers_ts.c
Url:
https://ccvs.cvshome.org/source/browse/ccvs/src/vers_ts.c?r1=1.43.4.6&r2=1.43.4.7
Delta lines: +29 -19
---------------------
--- vers_ts.c 31 Jan 2005 22:15:12 -0000 1.43.4.6
+++ vers_ts.c 22 Jun 2005 18:56:05 -0000 1.43.4.7
@@ -40,6 +40,7 @@
Vers_TS *vers_ts;
struct stickydirtag *sdtp;
Entnode *entdata;
+ char *rcsexpand = NULL;
#ifdef UTIME_EXPECTS_WRITABLE
int change_it_back = 0;
@@ -111,31 +112,40 @@
}
}
+ /* Always look up the RCS keyword mode when we have an RCS archive. It
+ * will either be needed as a default or to avoid allowing the -k options
+ * specified on the command line from overriding binary mode (-kb).
+ */
+ if (finfo->rcs != NULL)
+ rcsexpand = RCS_getexpand (finfo->rcs);
+
/*
* -k options specified on the command line override (and overwrite)
- * options stored in the entries file
+ * options stored in the entries file and default options from the RCS
+ * archive, except for binary mode (-kb).
*/
if (options && *options != '\0')
- vers_ts->options = xstrdup (options);
- else if (!vers_ts->options || *vers_ts->options == '\0')
{
- if (finfo->rcs != NULL)
+ if (vers_ts->options != NULL)
+ free (vers_ts->options);
+ if (rcsexpand != NULL && strcmp (rcsexpand, "b") == 0)
+ vers_ts->options = xstrdup ("-kb");
+ else
+ vers_ts->options = xstrdup (options);
+ }
+ else if ((!vers_ts->options || *vers_ts->options == '\0')
+ && rcsexpand != NULL)
{
/* If no keyword expansion was specified on command line,
use whatever was in the rcs file (if there is one). This
is how we, if we are the server, tell the client whether
a file is binary. */
- char *rcsexpand = RCS_getexpand (finfo->rcs);
- if (rcsexpand != NULL)
- {
if (vers_ts->options != NULL)
free (vers_ts->options);
vers_ts->options = xmalloc (strlen (rcsexpand) + 3);
strcpy (vers_ts->options, "-k");
strcat (vers_ts->options, rcsexpand);
}
- }
- }
if (!vers_ts->options)
vers_ts->options = xstrdup ("");
|