changeset 8821:c66e324d3961

Fix test-convert-cvsnt-mergepoints so it works reliably. Specifically, always run 'cvs commit' with -f option to force commit; add one strategic sleep which seems to be necessary for post-merge clobber-and-commit (-f doesn't force a commit there?).
author Greg Ward <greg-hg@gerg.ca>
date Mon, 15 Jun 2009 20:35:19 -0400
parents e8cb1fa0d4a9
children 1027da7d2fb9
files tests/test-convert-cvsnt-mergepoints tests/test-convert-cvsnt-mergepoints.out
diffstat 2 files changed, 21 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-convert-cvsnt-mergepoints	Mon Jun 15 20:35:19 2009 -0400
+++ b/tests/test-convert-cvsnt-mergepoints	Mon Jun 15 20:35:19 2009 -0400
@@ -17,8 +17,8 @@
 # -- just keep the part that matters
 cvsci()
 {
-    echo cvs -f ci "$@"
-    cvs -f ci "$@" 2>&1 | egrep "^(new|initial) revision:"
+    echo cvs -f ci -f "$@"
+    cvs -f ci -f "$@" 2>&1 | egrep "^(new|initial) revision:"
 }
 
 hgcat()
@@ -50,7 +50,7 @@
 cd foo
 echo foo > foo.txt
 cvscall -Q add foo.txt 
-cvsci -m "foo.txt"
+cvsci -m "add foo.txt" foo.txt
  
 cd ../..
 rm -rf cvsworktmp
@@ -63,33 +63,38 @@
 cvscall -q rtag -b -R MYBRANCH1 foo
 cvscall -Q update -P -r MYBRANCH1
 echo bar > foo.txt
-cvsci -m "bar"
+cvsci -m "bar" foo.txt
 echo baz > foo.txt
-cvsci -m "baz"
+cvsci -m "baz" foo.txt
 
 echo "% create MYBRANCH1_2 and modify foo.txt some more"
 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
 cvscall -Q update -P -r MYBRANCH1_2
 
 echo bazzie > foo.txt
-cvsci -m "bazzie"
+cvsci -m "bazzie" foo.txt
 
 echo "% create MYBRANCH1_1 and modify foo.txt yet again"
 cvscall -q rtag -b -R MYBRANCH1_1 foo
 cvscall -Q update -P -r MYBRANCH1_1
 
 echo quux > foo.txt
-cvsci -m "quux"
+cvsci -m "quux" foo.txt
 
 echo "% merge MYBRANCH1 to MYBRANCH1_1"
 filterpath cvscall -Q update -P -jMYBRANCH1
+# carefully placed sleep to dodge cvs bug (optimization?) where it
+# sometimes ignores a "commit" command if it comes too fast (the -f
+# option in cvsci seems to work for all the other commits in this
+# script)
+sleep 1
 echo xyzzy > foo.txt
-cvsci -m "merge1"
+cvsci -m "merge1+clobber" foo.txt
 
 echo "% return to trunk and merge MYBRANCH1_2"
 cvscall -Q update -P -A
 filterpath cvscall -Q update -P -jMYBRANCH1_2
-cvsci -m "merge2"
+cvsci -m "merge2" foo.txt
 
 REALCVS=`which cvs`
 echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs
--- a/tests/test-convert-cvsnt-mergepoints.out	Mon Jun 15 20:35:19 2009 -0400
+++ b/tests/test-convert-cvsnt-mergepoints.out	Mon Jun 15 20:35:19 2009 -0400
@@ -4,25 +4,25 @@
 cvs -f -Q checkout -d cvsworktmp .
 cvs -f -Q add foo
 cvs -f -Q add foo.txt
-cvs -f ci -m foo.txt
+cvs -f ci -f -m add foo.txt foo.txt
 initial revision: 1.1
 % checkout #2: create MYBRANCH1 and modify foo.txt on it
 cvs -f -Q checkout -d cvswork foo
 cvs -f -q rtag -b -R MYBRANCH1 foo
 cvs -f -Q update -P -r MYBRANCH1
-cvs -f ci -m bar
+cvs -f ci -f -m bar foo.txt
 new revision: 1.1.2.1; previous revision: 1.1
-cvs -f ci -m baz
+cvs -f ci -f -m baz foo.txt
 new revision: 1.1.2.2; previous revision: 1.1.2.1
 % create MYBRANCH1_2 and modify foo.txt some more
 cvs -f -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
 cvs -f -Q update -P -r MYBRANCH1_2
-cvs -f ci -m bazzie
+cvs -f ci -f -m bazzie foo.txt
 new revision: 1.1.2.2.2.1; previous revision: 1.1.2.2
 % create MYBRANCH1_1 and modify foo.txt yet again
 cvs -f -q rtag -b -R MYBRANCH1_1 foo
 cvs -f -Q update -P -r MYBRANCH1_1
-cvs -f ci -m quux
+cvs -f ci -f -m quux foo.txt
 new revision: 1.1.4.1; previous revision: 1.1
 % merge MYBRANCH1 to MYBRANCH1_1
 rcsmerge: warning: conflicts during merge
@@ -31,7 +31,7 @@
 retrieving revision 1.1
 retrieving revision 1.1.2.2
 Merging differences between 1.1 and 1.1.2.2 into foo.txt
-cvs -f ci -m merge1
+cvs -f ci -f -m merge1+clobber foo.txt
 new revision: 1.1.4.2; previous revision: 1.1.4.1
 % return to trunk and merge MYBRANCH1_2
 cvs -f -Q update -P -A
@@ -40,7 +40,7 @@
 retrieving revision 1.1
 retrieving revision 1.1.2.2.2.1
 Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt
-cvs -f ci -m merge2
+cvs -f ci -f -m merge2 foo.txt
 new revision: 1.2; previous revision: 1.1
 collecting CVS rlog
 7 log entries