[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog sanity.sh update.c [cvs1-11-x-branch]
From: |
Derek Robert Price |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog sanity.sh update.c [cvs1-11-x-branch] |
Date: |
Wed, 30 Jan 2008 22:23:36 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Branch: cvs1-11-x-branch
Changes by: Derek Robert Price <dprice> 08/01/30 22:23:34
Modified files:
src : ChangeLog sanity.sh update.c
Log message:
* update.c (join_file): Use local copy to detect deletion conflicts,
as opposed to the base revision. Restore freeing of rev2 to its
original location. Use simpler conflict message.
* sanity.sh: Update to compensate.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.2336.2.501&r2=1.2336.2.502
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.752.2.216&r2=1.752.2.217
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/update.c?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.202.4.32&r2=1.202.4.33
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.2336.2.501
retrieving revision 1.2336.2.502
diff -u -b -r1.2336.2.501 -r1.2336.2.502
--- ChangeLog 29 Jan 2008 22:40:50 -0000 1.2336.2.501
+++ ChangeLog 30 Jan 2008 22:23:31 -0000 1.2336.2.502
@@ -1,3 +1,10 @@
+2008-01-30 Derek R. Price <address@hidden>
+
+ * update.c (join_file): Use local copy to detect deletion conflicts,
+ as opposed to the base revision. Restore freeing of rev2 to its
+ original location. Use simpler conflict message.
+ * sanity.sh: Update to compensate.
+
2008-01-29 Derek R. Price <address@hidden>
* update.c (join_file): Remove trace that is no longer needed.
Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.752.2.216
retrieving revision 1.752.2.217
diff -u -b -r1.752.2.216 -r1.752.2.217
--- sanity.sh 29 Jan 2008 20:34:35 -0000 1.752.2.216
+++ sanity.sh 30 Jan 2008 22:23:32 -0000 1.752.2.217
@@ -5470,7 +5470,7 @@
# and join
dotest 95 "$testcvs -q update -j HEAD" \
-"$PROG update: file file1 is modified since GCA (1\.3), but has been removed
in revision HEAD
+"$PROG update: file file1 has been removed in revision HEAD, but the
destination is incompatibly modified
C file1
$PROG update: file file3 exists, but has been added in revision HEAD"
@@ -9348,7 +9348,7 @@
U first-dir/file3
$PROG checkout: scheduling first-dir/file3 for removal
U first-dir/file4
-$PROG checkout: file first-dir/file4 is modified since GCA (1\.1), but has
been removed in revision T2
+$PROG checkout: file first-dir/file4 has been removed in revision T2, but the
destination is incompatibly modified
C first-dir/file4
U first-dir/file7
$PROG checkout: file first-dir/file9 does not exist, but is present in
revision T2"
@@ -9368,7 +9368,7 @@
$PROG update: file file2 exists, but has been added in revision T2
$PROG update: scheduling file3 for removal
M file4
-$PROG update: file file4 is locally modified, but has been removed in revision
T2
+$PROG update: file file4 has been removed in revision T2, but the destination
is incompatibly modified
C file4
$PROG update: file file9 does not exist, but is present in revision T2"
@@ -9401,7 +9401,7 @@
U first-dir/file3
$PROG checkout: scheduling first-dir/file3 for removal
U first-dir/file4
-$PROG checkout: file first-dir/file4 is modified since GCA (1\.1), but has
been removed in revision branch
+$PROG checkout: file first-dir/file4 has been removed in revision branch, but
the destination is incompatibly modified
C first-dir/file4
U first-dir/file7
$PROG checkout: file first-dir/file9 does not exist, but is present in
revision branch"
@@ -9437,7 +9437,7 @@
Merging differences between 1\.1 and 1\.1\.2\.2 into file2
$PROG update: scheduling file3 for removal
M file4
-$PROG update: file file4 is locally modified, but has been removed in revision
branch
+$PROG update: file file4 has been removed in revision branch, but the
destination is incompatibly modified
C file4
$PROG update: file file9 does not exist, but is present in revision branch"
@@ -9480,7 +9480,7 @@
retrieving revision 1\.1\.2\.2
Merging differences between 1\.1 and 1\.1\.2\.2 into file2
$PROG update: scheduling file3 for removal
-$PROG update: file file4 is modified since GCA (1\.1), but has been removed in
revision branch
+$PROG update: file file4 has been removed in revision branch, but the
destination is incompatibly modified
C file4
U file8
U file9"
@@ -9500,7 +9500,7 @@
# once that if the file was removed in the update then it wouldn't be
# readded in the merge
cd ..
- rm -r first-dir
+ rm -rf first-dir
dotest join-twobranch-1 "${testcvs} -q co -rbranch first-dir" \
'U first-dir/file1
U first-dir/file2
@@ -9518,7 +9518,7 @@
U file3
$PROG update: scheduling file3 for removal
U file4
-$PROG update: file file4 is modified since GCA (1\.1), but has been removed in
revision branch
+$PROG update: file file4 has been removed in revision branch, but the
destination is incompatibly modified
C file4
U file7
$PROG update: file8 is no longer in the repository
@@ -10040,7 +10040,7 @@
$PROG update: file file2 exists, but has been added in revision T2
$PROG update: scheduling file3 for removal
M file4
-$PROG update: file file4 is locally modified, but has been removed in revision
T2
+$PROG update: file file4 has been removed in revision T2, but the destination
is incompatibly modified
C file4
R file6
A file7
@@ -10423,10 +10423,20 @@
"$testcvs checkout -r pvcs-1 -j base-1 -j project-1 -d combine join8" \
"$PROG checkout: Updating combine
U combine/file\.txt
-$PROG checkout: file combine/file\.txt is modified since GCA (1\.1), but has
been removed in revision project-1
+$PROG checkout: file combine/file\.txt has been removed in revision project-1,
but the destination is incompatibly modified
C combine/file.txt
U combine/xxx\.txt"
+ dotest join8-5 \
+"$testcvs -Q up -pr base-1 combine/file.txt >combine/file.txt"
+
+ dotest join8-6 \
+"$testcvs up -j base-1 -j project-1 combine" \
+"$PROG update: Updating combine
+M combine/file\.txt
+$PROG update: scheduling combine/file\.txt for removal
+A combine/xxx\.txt
+$PROG update: file combine/xxx\.txt exists, but has been added in revision
project-1"
cd ..
if $keep; then
Index: update.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/update.c,v
retrieving revision 1.202.4.32
retrieving revision 1.202.4.33
diff -u -b -r1.202.4.32 -r1.202.4.33
--- update.c 29 Jan 2008 22:40:51 -0000 1.202.4.32
+++ update.c 30 Jan 2008 22:23:33 -0000 1.202.4.33
@@ -2210,7 +2210,9 @@
{
char *mrev;
short conflict = 0;
- char *modmsg = NULL;
+
+ if (rev2 != NULL)
+ free (rev2);
/* If the first revision doesn't exist either, then there is
no change between the two revisions, so we don't do
@@ -2219,8 +2221,6 @@
{
if (rev1 != NULL)
free (rev1);
- if (rev2 != NULL)
- free (rev2);
return;
}
@@ -2261,8 +2261,6 @@
|| RCS_isdead (vers->srcfile, vers->vn_user))
{
free (rev1);
- if (rev2 != NULL)
- free (rev2);
return;
}
@@ -2271,14 +2269,13 @@
resolve. No_Difference will already have been called in
this case, so comparing the timestamps is sufficient to
determine whether the file is locally modified. */
- if (/* added */ !strcmp (vers->vn_user, "0")
+ if (/* may have changed on destination branch */
+ /* file added locally */
+ !strcmp (vers->vn_user, "0")
+ || /* destination branch modified in repository */
+ strcmp (rev1, vers->vn_user)
|| /* locally modified */
vers->ts_user && strcmp (vers->ts_user, vers->ts_rcs))
- conflict = 1;
-
- if (!conflict
- && /* may have changed */
- strcmp (rev1, vers->vn_user))
{
/* The removal should happen if either the file has never changed
* on the destination or the file has changed to be identical to
@@ -2297,45 +2294,51 @@
* if D == R removal should happen
* otherwise, fail.
*
- * (In the source, J2 = REV2, D = VN_USER, R = GCA computed below)
+ * (In the source, J2 = REV2, D = user file (potentially VN_USER),
+ * R = GCA computed below)
*/
char *gca_rev1 = gca (rev1, vers->vn_user);
+#ifdef SERVER_SUPPORT
+ if (server_active && !isreadable (finfo->file))
+ {
+ int retcode;
+ /* The file is up to date. Need to check out the current
+ * contents.
+ */
+ /* FIXME - see the FIXME comment above the call to RCS_checkout
+ * in the patch_file function.
+ */
+ retcode = RCS_checkout (vers->srcfile, finfo->file,
+ vers->vn_user, vers->tag,
+ NULL, RUN_TTY, NULL, NULL);
+ if (retcode)
+ error (1, 0,
+ "failed to check out %s file", finfo->fullname);
+ }
+#endif
if (/* genuinely changed on destination branch */
RCS_cmp_file (vers->srcfile, gca_rev1, NULL,
- vers->vn_user, vers->options, finfo->file)
+ NULL, vers->options, finfo->file)
&& /* genuinely different from REV1 */
RCS_cmp_file (vers->srcfile, rev1, NULL,
- vers->vn_user, vers->options, finfo->file))
- {
+ NULL, vers->options, finfo->file))
conflict = 1;
- modmsg = xmalloc (14 + strlen (gca_rev1));
- sprintf (modmsg, " since GCA (%s)", gca_rev1);
- }
}
+ free (rev1);
+
if (conflict)
{
- const char *locally;
char *cp;
- if (!modmsg)
- modmsg = xstrdup ("");
-
- if (/* added */ !strcmp (vers->vn_user, "0")
- || /* locally modified */
- vers->ts_user && strcmp (vers->ts_user, vers->ts_rcs))
- locally = " locally";
- else
- locally = "";
-
if (jdate2)
error (0, 0,
- "file %s is%s modified%s, but has been removed in
revision %s as of %s",
- finfo->fullname, locally, modmsg, jrev2, jdate2);
+ "file %s has been removed in revision %s as of %s, but
the destination is incompatibly modified",
+ finfo->fullname, jrev2, jdate2);
else
error (0, 0,
- "file %s is%s modified%s, but has been removed in
revision %s",
- finfo->fullname, locally, modmsg, jrev2);
+ "file %s has been removed in revision %s, but the
destination is incompatibly modified",
+ finfo->fullname, jrev2);
/* Register the conflict with the client. */
@@ -2364,18 +2367,9 @@
finfo->repository);
#endif
- free (modmsg);
- free (rev1);
- if (rev2 != NULL)
- free (rev2);
-
return;
}
- free (rev1);
- if (rev2 != NULL)
- free (rev2);
-
/* The user file exists and has not been modified. Mark it
for removal. FIXME: If we are doing a checkout, this has
the effect of first checking out the file, and then