[PATCH 3 of 3] Fix test-convert-cvsnt-mergepoints so it works reliably

Greg Ward greg-hg at gerg.ca
Mon Jun 8 21:07:17 CDT 2009


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1244513181 14400
# Node ID a64bd5ee8e1eff9b5972e1b55cc0ee7df0ac115f
# Parent  a67096c8d047848b702844a72c7866a169ed9eac
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?).

diff --git a/tests/test-convert-cvsnt-mergepoints b/tests/test-convert-cvsnt-mergepoints
--- a/tests/test-convert-cvsnt-mergepoints
+++ b/tests/test-convert-cvsnt-mergepoints
@@ -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
diff --git a/tests/test-convert-cvsnt-mergepoints.out b/tests/test-convert-cvsnt-mergepoints.out
--- a/tests/test-convert-cvsnt-mergepoints.out
+++ b/tests/test-convert-cvsnt-mergepoints.out
@@ -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


More information about the Mercurial-devel mailing list