[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog checkout.c commit.c diff.c s...
From: |
Mark D. Baushke |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog checkout.c commit.c diff.c s... |
Date: |
Wed, 05 Nov 2008 15:17:16 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Changes by: Mark D. Baushke <mdb> 08/11/05 15:17:15
Modified files:
src : ChangeLog checkout.c commit.c diff.c sanity.sh
update.c
Log message:
Merge changes from 1.11.x.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3629&r2=1.3630
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/checkout.c?cvsroot=cvs&r1=1.158&r2=1.159
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/commit.c?cvsroot=cvs&r1=1.288&r2=1.289
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/diff.c?cvsroot=cvs&r1=1.122&r2=1.123
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&r1=1.1214&r2=1.1215
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/update.c?cvsroot=cvs&r1=1.286&r2=1.287
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3629
retrieving revision 1.3630
diff -u -b -r1.3629 -r1.3630
--- ChangeLog 15 Oct 2008 18:48:02 -0000 1.3629
+++ ChangeLog 5 Nov 2008 15:17:12 -0000 1.3630
@@ -1,3 +1,25 @@
+2008-11-05 Mark D. Baushke <address@hidden>
+
+ *diff.c (diff): Use SEND_FORCE on files when a -k option is used
+ with diff to avoid client/server not finding the requested file.
+ * sanity.sh (keyword): Add tests for this.
+
+ * checkout.c (checkout): For multiroot checkout/update operations,
+ do not assume that the static join_rev1 and join_rev2 strings will
+ not be seen again with another repository.
+ * update.c (update): Ditto.
+ * commit.c (commit): For multiroot commits with -F logmessage
+ do not generate "cannot specify both a message and a log file"
+ errors. Track the use of -m as an argument explicitly.
+ (finaladd): API change to pass the saved_message.
+ (check_fileproc, commit_fileproc, commit_filesdoneproc): Pass the
+ saved_message via the callerdat block.
+ (commit_direntproc): Ditto.
+ * sanity.sh (multiroot-{commit-2,update-join-{1,2},admin-{1,2,3,4}}):
+ Do commits with -F logmessage to test above and also look at other
+ broken behavior which needs to be fixed. There are some FIXME
+ tests here which should be addressed.
+
2008-10-15 Derek R. Price <address@hidden>
* checkout.c (findslash): Declare inputs const. Use ISSLASH().
Index: checkout.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/checkout.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -b -r1.158 -r1.159
--- checkout.c 15 Oct 2008 18:50:07 -0000 1.158
+++ checkout.c 5 Nov 2008 15:17:13 -0000 1.159
@@ -128,6 +128,7 @@
int shorten = -1;
char *where = NULL;
const char *valid_options;
+ int jrev_count = 0;
const char *const *valid_usage;
char *join_orig1, *join_orig2;
@@ -235,15 +236,15 @@
checkout_prune_dirs = 1;
break;
case 'j':
- if (join_rev2 || join_date2)
+ jrev_count++;
+ if (jrev_count > 2)
error (1, 0, "only two -j options can be specified");
- if (join_rev1 || join_date1)
- {
+ if (jrev_count == 2) {
if (join_orig2) free (join_orig2);
join_orig2 = xstrdup (optarg);
parse_tagdate (&join_rev2, &join_date2, optarg);
}
- else
+ else if (jrev_count == 1)
{
if (join_orig1) free (join_orig1);
join_orig1 = xstrdup (optarg);
Index: commit.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/commit.c,v
retrieving revision 1.288
retrieving revision 1.289
diff -u -b -r1.288 -r1.289
--- commit.c 29 Sep 2008 02:28:50 -0000 1.288
+++ commit.c 5 Nov 2008 15:17:14 -0000 1.289
@@ -60,7 +60,7 @@
const char *repository,
const char *update_dir, List *entries);
static int finaladd (struct file_info *finfo, char *revision, char *tag,
- char *options);
+ char *options, char *msg);
static int findmaxrev (Node * p, void *closure);
static int lock_RCS (const char *user, RCSNode *rcs, const char *rev,
const char *repository);
@@ -85,6 +85,10 @@
List *cilist; /* list with commit_info structs */
};
+struct commit_data
+{
+ char *saved_message;
+};
static int check_valid_edit = 0;
static int force_ci = 0;
static int got_message;
@@ -94,7 +98,6 @@
static int write_dirnonbranch;
static char *logfile;
static List *mulist;
-static char *saved_message;
static time_t last_register_time;
static const char *const commit_usage[] =
@@ -363,6 +366,7 @@
int c;
int err = 0;
int local = 0;
+ struct commit_data commit_data;
#ifdef CLIENT_SUPPORT
int flags;
@@ -375,6 +379,8 @@
const char short_options[] = COMMIT_OPTIONS;
#endif /* SERVER_SUPPORT */
+ memset(&commit_data, 0, sizeof commit_data);
+
if (argc == -1)
usage (commit_usage);
@@ -423,13 +429,13 @@
#else
use_editor = 0;
#endif
- if (saved_message)
+ if (commit_data.saved_message)
{
- free (saved_message);
- saved_message = NULL;
+ free (commit_data.saved_message);
+ commit_data.saved_message = NULL;
}
- saved_message = xstrdup (optarg);
+ commit_data.saved_message = xstrdup (optarg);
break;
case 'r':
if (saved_tag)
@@ -481,10 +487,11 @@
{
size_t size = 0, len;
- if (saved_message)
+ if (commit_data.saved_message)
error (1, 0, "cannot specify both a message and a log file");
- get_file (logfile, logfile, "r", &saved_message, &size, &len);
+ get_file (logfile, logfile, "r", &commit_data.saved_message,
+ &size, &len);
}
#ifdef CLIENT_SUPPORT
@@ -553,10 +560,12 @@
* The protocol is designed this way. This is a feature.
*/
if (use_editor)
- do_editor (NULL, &saved_message, NULL, find_args.ulist);
+ do_editor (NULL, &commit_data.saved_message, NULL,
+ find_args.ulist);
/* We always send some sort of message, even if empty. */
- option_with_arg ("-m", saved_message ? saved_message : "");
+ option_with_arg ("-m", commit_data.saved_message
+ ? commit_data.saved_message : "");
/* OK, now process all the questionable files we have been saving
up. */
@@ -646,7 +655,7 @@
send_to_server ("ci\012", 0);
err = get_responses_and_close ();
- if (err != 0 && use_editor && saved_message != NULL)
+ if (err != 0 && use_editor && commit_data.saved_message != NULL)
{
/* If there was an error, don't nuke the user's carefully
constructed prose. This is something of a kludge; a better
@@ -664,8 +673,9 @@
if (fp == NULL)
error (1, 0, "cannot create temporary file %s",
fname ? fname : "(null)");
- if (fwrite (saved_message, 1, strlen (saved_message), fp)
- != strlen (saved_message))
+ if (fwrite (commit_data.saved_message, 1,
+ strlen (commit_data.saved_message), fp)
+ != strlen (commit_data.saved_message))
error (1, errno, "cannot write temporary file %s", fname);
if (fclose (fp) < 0)
error (0, errno, "cannot close temporary file %s", fname);
@@ -710,7 +720,8 @@
* Run the recursion processor to verify the files are all up-to-date
*/
if (start_recursion (check_fileproc, check_filesdoneproc,
- check_direntproc, NULL, NULL, argc, argv, local,
+ check_direntproc, NULL, &commit_data,
+ argc, argv, local,
W_LOCAL, aflag, CVS_LOCK_NONE, NULL, 1, NULL))
error (1, 0, "correct above errors first!");
@@ -720,7 +731,8 @@
write_dirnonbranch = 0;
if (noexec == 0)
err = start_recursion (commit_fileproc, commit_filesdoneproc,
- commit_direntproc, commit_dirleaveproc, NULL,
+ commit_direntproc, commit_dirleaveproc,
+ &commit_data,
argc, argv, local, W_LOCAL, aflag,
CVS_LOCK_WRITE, NULL, 1, NULL);
@@ -730,6 +742,12 @@
Lock_Cleanup ();
dellist (&mulist);
+ if (commit_data.saved_message)
+ {
+ free (commit_data.saved_message);
+ commit_data.saved_message = NULL;
+ }
+
/* see if we need to sleep before returning to avoid time-stamp races */
if (!server_active && last_register_time)
{
@@ -1381,6 +1399,7 @@
int n;
Node *p;
List *saved_ulist;
+ struct commit_data *commit_data = callerdat;
TRACE (TRACE_FLOW, "check_filesdoneproc (%d, %s, %s, %s)",
err, repos, update_dir, TRACE_BOOL (use_editor));
@@ -1413,9 +1432,10 @@
*/
got_message = 1;
if (!server_active && use_editor)
- do_editor (update_dir, &saved_message, repos, saved_ulist);
+ do_editor (update_dir, &commit_data->saved_message, repos,
+ saved_ulist);
- err += do_verify (&saved_message, repos, saved_ulist);
+ err += do_verify (&commit_data->saved_message, repos, saved_ulist);
return err;
}
@@ -1436,6 +1456,7 @@
int err = 0;
List *ulist, *cilist;
struct commit_info *ci;
+ struct commit_data *commit_data = callerdat;
/* Keep track of whether write_dirtag is a branch tag.
Note that if it is a branch tag in some files and a nonbranch tag
@@ -1510,7 +1531,7 @@
free (ci->rev);
ci->rev = RCS_whatbranch (finfo->rcs, ci->tag);
err = Checkin ('A', finfo, ci->rev,
- ci->tag, ci->options, saved_message);
+ ci->tag, ci->options, commit_data->saved_message);
if (err != 0)
{
unlockrcs (finfo->rcs);
@@ -1548,14 +1569,16 @@
}
/* XXX - an added file with symbolic -r should add tag as well */
- err = finaladd (finfo, ci->rev ? ci->rev : xrev, ci->tag, ci->options);
+ err = finaladd (finfo, ci->rev ? ci->rev : xrev, ci->tag, ci->options,
+ commit_data->saved_message);
+
if (xrev)
free (xrev);
}
else if (ci->status == T_MODIFIED)
{
err = Checkin ('M', finfo, ci->rev, ci->tag,
- ci->options, saved_message);
+ ci->options, commit_data->saved_message);
(void) time (&last_register_time);
@@ -1567,7 +1590,7 @@
}
else if (ci->status == T_REMOVED)
{
- err = remove_file (finfo, ci->tag, saved_message);
+ err = remove_file (finfo, ci->tag, commit_data->saved_message);
#ifdef SERVER_SUPPORT
if (server_active)
{
@@ -1647,6 +1670,7 @@
{
Node *p;
List *ulist;
+ struct commit_data *commit_data = callerdat;
assert (repository);
@@ -1715,7 +1739,7 @@
* A more general solution I have been considering is calling a generic
* "postwrite" hook from the remove write lock routine.
*/
- Update_Logfile (repository, saved_message, NULL, ulist);
+ Update_Logfile (repository, commit_data->saved_message, NULL, ulist);
return err;
}
@@ -1966,11 +1990,12 @@
* Do the actual checkin for added files
*/
static int
-finaladd (struct file_info *finfo, char *rev, char *tag, char *options)
+finaladd (struct file_info *finfo, char *rev, char *tag, char *options,
+ char *msg)
{
int ret;
- ret = Checkin ('A', finfo, rev, tag, options, saved_message);
+ ret = Checkin ('A', finfo, rev, tag, options, msg);
if (ret == 0)
{
char *tmp = Xasprintf ("%s/%s%s", CVSADM, finfo->file, CVSEXT_LOG);
Index: diff.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/diff.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -b -r1.122 -r1.123
--- diff.c 17 Sep 2008 16:06:13 -0000 1.122
+++ diff.c 5 Nov 2008 15:17:14 -0000 1.123
@@ -445,6 +445,8 @@
if ((!suppress_bases && supported_request ("Base-diff"))
|| diff_rev2 || diff_date2)
flags |= SEND_NO_CONTENTS;
+ else if (options[0] != '\0')
+ flags |= SEND_FORCE;
send_files (argc, argv, local, 0, flags);
Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.1214
retrieving revision 1.1215
diff -u -b -r1.1214 -r1.1215
--- sanity.sh 2 Oct 2008 18:44:37 -0000 1.1214
+++ sanity.sh 5 Nov 2008 15:17:14 -0000 1.1215
@@ -26540,6 +26540,18 @@
dotest keyword-24 "cat file1" '\$'"Name: "'\$'"
change"
+ dotest_fail keyword-25 "${testcvs} diff -kk file1" \
+"Index: file1
+===================================================================
+RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
+retrieving revision 1\.3
+diff -r1\.3 file1
+1c1
+< \$Name\$
+---
+> \$Name: $"
+ dotest keyword-26 "${testcvs} diff -kkv file1" ""
+
dokeep
cd ../..
rm -rf 1
@@ -30922,6 +30934,91 @@
${CVSROOT2_DIRNAME}/mod2-2/file2-2,v <-- mod2-2/file2-2
new revision: 1.2; previous revision: 1.1"
+ echo Extra-line >> mod1-1/file1-1
+ echo Extra-line >> mod2-2/file2-2
+ echo 'Using a message file.' >log-message.txt
+ dotest multiroot-commit-2 \
+"${testcvs} commit -F log-message.txt mod1-1/file1-1 mod2-2/file2-2" \
+"${CVSROOT1_DIRNAME}/mod1-1/file1-1,v <-- mod1-1/file1-1
+new revision: 1\.3; previous revision: 1\.2
+${CVSROOT2_DIRNAME}/mod2-2/file2-2,v <-- mod2-2/file2-2
+new revision: 1\.3; previous revision: 1\.2"
+
+ dotest multiroot-update-join-1 \
+"${testcvs} update -j1.3 -j1.2 mod1-1/file1-1 mod2-2/file2-2" \
+"${CPROG} update: Replacing \`mod1-1/file1-1' with contents of revision 1\.2\.
+M mod1-1/file1-1
+${CPROG} update: Replacing \`mod2-2/file2-2' with contents of revision 1\.2\.
+M mod2-2/file2-2"
+ dotest multiroot-update-join-2 \
+"${testcvs} -Q update -C mod1-1/file1-1 mod2-2/file2-2" \
+""
+
+ rm log-message.txt
+ dotest multiroot-admin-1 "${testcvs} admin -o1.3 mod1-1/file1-1" \
+"RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
+deleting revision 1.3
+done"
+ # FIXME: For $remote operation, an error like:
+ # cvs [admin aborted]: no such directory `mod2-2'
+ # will happen if the CVS/Root has $CVSROOT1 in it.
+ # If CVS is missing and there is no CVSROOT environment
+ # variable, there is also a "No CVSROOT specified!"
+ # error which really needs to be fixed too.
+ dotest multiroot-admin-2 \
+"${testcvs} -d ${CVSROOT2} admin -o1.3 mod2-2/file2-2" \
+"RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
+deleting revision 1.3
+done"
+
+ if $remote; then
+ # FIXME: Just becuase CVS/Root does not have a mod2-2
+ # directory does not mean that recurse should print an
+ # error.
+ dotest multiroot-admin-3ra "${testcvs} status mod2-2/file2-2" \
+"${CPROG} \[status aborted\]: no such directory \`mod2-2'
+===================================================================
+File: file2-2 Status: Needs Patch
+
+ Working revision: 1\.3
+ Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
+ Commit Identifier: ${commitid}
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+
+ dotest_fail multiroot-admin-3rb \
+"${testcvs} update mod1-1/file1-1 mod2-2/file2-2" \
+"${CPROG} \[update aborted\]: could not find desired version 1\.3 in
${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
+${CPROG} \[update aborted\]: could not find desired version 1\.3 in
${CVSROOT2_DIRNAME}/mod2-2/file2-2,v"
+
+ # FIXME. For client/server, the removal of revisoin 1.3 is not
+ # directly recoverable without hacking CVS/Entries here.
+ mv mod1-1/CVS/Entries mod1-1/CVS/Entries.bad
+ grep -v file1-1 < mod1-1/CVS/Entries.bad > mod1-1/CVS/Entries
+ mv mod2-2/CVS/Entries mod2-2/CVS/Entries.bad
+ grep -v file2-2 < mod2-2/CVS/Entries.bad > mod2-2/CVS/Entries
+ rm mod1-1/CVS/Entries.bad mod2-2/CVS/Entries.bad
+ rm mod1-1/file1-1 mod2-2/file2-2
+ else
+ dotest multiroot-admin-3 "${testcvs} status mod2-2/file2-2" \
+"===================================================================
+File: file2-2 Status: Needs Patch
+
+ Working revision: 1\.3.*
+ Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
+ Commit Identifier: ${commitid}
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ fi
+
+ dotest multiroot-admin-4 \
+"${testcvs} update mod1-1/file1-1 mod2-2/file2-2" \
+"U mod1-1/file1-1
+U mod2-2/file2-2"
+
+
dotest multiroot-update-2 "${testcvs} update" \
"${CPROG} update: Updating \.
${CPROG} update: Updating mod1-1
Index: update.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/update.c,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -b -r1.286 -r1.287
--- update.c 29 Sep 2008 17:46:29 -0000 1.286
+++ update.c 5 Nov 2008 15:17:15 -0000 1.287
@@ -165,6 +165,7 @@
int c, err;
int local = 0; /* recursive by default */
int which; /* where to look for files and dirs */
+ int jrev_count = 0; /* multiple cvsroot w/ -j
options */
char *xjoin_rev1, *xjoin_date1,
*xjoin_rev2, *xjoin_date2,
*join_orig1, *join_orig2;
@@ -237,14 +238,15 @@
noexec = 1; /* so no locks will be created */
break;
case 'j':
- if (join_orig2)
+ jrev_count++;
+ if (jrev_count > 2)
error (1, 0, "only two -j options can be specified");
- if (join_orig1)
+ if (jrev_count == 2)
{
join_orig2 = xstrdup (optarg);
parse_tagdate (&xjoin_rev2, &xjoin_date2, optarg);
}
- else
+ else if (jrev_count == 1)
{
join_orig1 = xstrdup (optarg);
parse_tagdate (&xjoin_rev1, &xjoin_date1, optarg);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cvs-cvs] ccvs/src ChangeLog checkout.c commit.c diff.c s...,
Mark D. Baushke <=