bug-cvs
[Top][All Lists]
Advanced

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

Re: join not producing conflict


From: Mark D. Baushke
Subject: Re: join not producing conflict
Date: Mon, 20 Oct 2003 09:59:59 -0700

Hi Paul,

Okay, the code that is causing you problems is probably 'fixed'
by using the patch following my .signature.

Of course, it breaks at least one of the current sanity.sh test cases
(import-113). I am still running thru the test suite to see if there is
any more collateral damage that needs to be fixed.

I really want Derek or Larry to look at this and determine if it
is a safe patch from their point of view.

It would be useful if you could test it to make sure it does the
right thing from your point of view.

        Thanks,
        -- Mark

Log Message:
2003-10-20  Mark D. Baushke  <mdb@cvshome.org>

        * update.c (join_file): Avoid short cuts.
        * sanity.sh (join6): New testcase for above.
        (Suggested by "Paul Edwards" <kerravon@nosppaam.w3.to>.)
        (import): Fix collateral damage.
        
Index: update.c
===================================================================
RCS file: /cvs/ccvs/src/update.c,v
retrieving revision 1.202.4.7
diff -u -p -r1.202.4.7 update.c
--- update.c    8 Oct 2003 21:15:48 -0000       1.202.4.7
+++ update.c    20 Oct 2003 16:56:07 -0000
@@ -2317,14 +2317,10 @@ join_file (finfo, vers)
     }
 
     /* If the target of the merge is the same as the working file
-       revision, then there is nothing to do.  */
-    if (vers->vn_user != NULL && strcmp (rev2, vers->vn_user) == 0)
-    {
-       if (rev1 != NULL)
-           free (rev1);
-       free (rev2);
-       return;
-    }
+       revision, then there is nothing to do.
+       This is a bad assumption, so an optimization that was here has
+       been removed, the modified file may need to have a change put
+       back into it which may or may not cause a conflict.  */
 
     /* If rev1 is dead or does not exist, then the file was added
        between rev1 and rev2.  */
Index: sanity.sh
===================================================================
RCS file: /cvs/ccvs/src/sanity.sh,v
retrieving revision 1.752.2.46
diff -u -p -r1.752.2.46 sanity.sh
--- sanity.sh   19 Oct 2003 15:13:14 -0000      1.752.2.46
+++ sanity.sh   20 Oct 2003 16:56:53 -0000
@@ -714,8 +714,8 @@ if test x"$*" = x; then
        tests="${tests} rmadd2 dirs dirs2 branches branches2 tagc tagf"
        tests="${tests} rcslib multibranch import importb importc"
        tests="${tests} update-p import-after-initial branch-after-import"
-       tests="${tests} join join2 join3 join4 join5 join-readonly-conflict"
-       tests="${tests} join-admin join-admin-2"
+       tests="${tests} join join2 join3 join4 join5 join6"
+       tests="${tests} join-readonly-conflict join-admin join-admin-2"
        tests="${tests} new newb conflicts conflicts2 conflicts3"
        tests="${tests} clean"
        # Checking out various places (modules, checkout -d, &c)
@@ -7184,7 +7184,15 @@ RCS file: ${CVSROOT_DIRNAME}/first-dir/i
 retrieving revision 1\.1\.1\.1
 retrieving revision 1\.1\.1\.2
 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
-rcsmerge: warning: conflicts during merge"
+rcsmerge: warning: conflicts during merge
+RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f3,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.2
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f3
+RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f4,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.3
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.3 into imported-f4"
 
                cd first-dir
 
@@ -8646,6 +8654,60 @@ C -file"
          cd ..
          rm -r join5
          rm -rf ${CVSROOT_DIRNAME}/join5
+         ;;
+
+        join6)
+         mkdir join6; cd join6
+          mkdir 1; cd 1
+         dotest join6-init-1 "${testcvs} -Q co -l ."
+         mkdir join6
+         dotest join6-init-2 "${testcvs} -Q add join6"
+         cd join6
+          echo aaa >temp.txt
+         echo bbb >>temp.txt
+         echo ccc >>temp.txt
+         dotest join6-1 "${testcvs} -Q add temp.txt"
+         dotest join6-2 "${testcvs} -q commit -minitial temp.txt" \
+"RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
+done
+Checking in temp\.txt;
+${CVSROOT_DIRNAME}/join6/temp.txt,v  <--  temp\.txt
+initial revision: 1\.1
+done"
+         cp temp.txt temp2.txt
+         echo ddd >>temp.txt
+         dotest join6-3 "${testcvs} -q commit -madd temp.txt" \
+"Checking in temp\.txt;
+${CVSROOT_DIRNAME}/join6/temp.txt,v  <--  temp\.txt
+new revision: 1\.2; previous revision: 1\.1
+done"
+         cp temp2.txt temp.txt
+         dotest_fail join6-4 "${testcvs} diff temp.txt" \
+"Index: temp.txt
+===================================================================
+RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
+retrieving revision 1\.2
+diff -r1\.2 temp\.txt
+4d3
+< ddd"
+
+         dotest join6-5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
+"M temp\.txt
+RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
+retrieving revision 1\.1
+retrieving revision 1\.2
+Merging differences between 1\.1 and 1\.2 into temp\.txt"
+         dotest join6-6 "${testcvs} diff temp.txt" ""
+
+         cd ../../..
+
+         if $keep; then
+           echo Keeping ${TESTDIR} and exiting due to --keep
+            exit 0
+         fi
+
+         rm -r join6
+         rm -rf ${CVSROOT_DIRNAME}/join6
          ;;
 
        join-readonly-conflict)




reply via email to

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