comparison tests/test-convert-cvsnt-mergepoints @ 8819:e93ab347c814

test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12. - factor out cvsci function (similar to other test-convert-cvs* scripts) - add filterpath function (also similar to other scripts) - generally munge the output of CVS - add lots of output to make it easier to follow when things go wrong This doesn't make the test pass reliably under CVS 1.11; it just makes it behave the same as under CVS 1.12, i.e. sometimes it passes and sometimes it fails. Failure is more frequent with faster hardware.
author Greg Ward <greg-hg@gerg.ca>
date Mon, 15 Jun 2009 20:35:19 -0400
parents 727f7aaefaab
children e8cb1fa0d4a9
comparison
equal deleted inserted replaced
8818:727f7aaefaab 8819:e93ab347c814
1 #!/bin/sh 1 #!/bin/sh
2 2
3 "$TESTDIR/hghave" cvs || exit 80 3 "$TESTDIR/hghave" cvs || exit 80
4 4
5 filterpath()
6 {
7 eval "$@" | sed "s:$CVSROOT:*REPO*:g"
8 }
9
5 cvscall() 10 cvscall()
6 { 11 {
12 echo cvs -f "$@"
7 cvs -f "$@" 13 cvs -f "$@"
14 }
15
16 # output of 'cvs ci' varies unpredictably, so discard most of it
17 # -- just keep the part that matters
18 cvsci()
19 {
20 echo cvs -f ci "$@"
21 cvs -f ci "$@" 2>&1 | egrep "^(new|initial) revision:"
8 } 22 }
9 23
10 hgcat() 24 hgcat()
11 { 25 {
12 hg --cwd src-hg cat -r tip "$1" 26 hg --cwd src-hg cat -r tip "$1"
16 echo "convert = " >> $HGRCPATH 30 echo "convert = " >> $HGRCPATH
17 echo "graphlog = " >> $HGRCPATH 31 echo "graphlog = " >> $HGRCPATH
18 echo "[convert]" >> $HGRCPATH 32 echo "[convert]" >> $HGRCPATH
19 echo "cvsps=builtin" >> $HGRCPATH 33 echo "cvsps=builtin" >> $HGRCPATH
20 34
21 echo % create cvs repository 35 echo "% create cvs repository"
22 mkdir cvsmaster 36 mkdir cvsmaster
23 cd cvsmaster 37 cd cvsmaster
24 CVSROOT=`pwd` 38 CVSROOT=`pwd`
25 export CVSROOT 39 export CVSROOT
26 CVS_OPTIONS=-f 40 CVS_OPTIONS=-f
27 export CVS_OPTIONS 41 export CVS_OPTIONS
28 cd .. 42 cd ..
43 filterpath cvscall -Q -d "$CVSROOT" init
29 44
30 cvscall -q -d "$CVSROOT" init 45 echo "% checkout #1: add foo.txt"
31 46 cvscall -Q checkout -d cvsworktmp .
32 cvscall -q checkout -d cvsworktmp .
33 cd cvsworktmp 47 cd cvsworktmp
34 mkdir foo 48 mkdir foo
35 cvscall -q add foo | sed -e 's/Directory .* added to the repository//g' 49 cvscall -Q add foo
36 cd foo 50 cd foo
37 echo foo > foo.txt 51 echo foo > foo.txt
38 cvscall -q add foo.txt 52 cvscall -Q add foo.txt
39 cvscall -q ci -m "foo.txt" | sed 's/.*,v.*/checking in/g' 53 cvsci -m "foo.txt"
40 54
41 cd ../.. 55 cd ../..
42 rm -rf cvsworktmp 56 rm -rf cvsworktmp
43 57
44 cvscall -q checkout -d cvswork foo 58 echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it"
59 cvscall -Q checkout -d cvswork foo
45 60
46 cd cvswork 61 cd cvswork
47 62
48 cvscall -q rtag -b -R MYBRANCH1 foo 63 cvscall -q rtag -b -R MYBRANCH1 foo
49 cvscall -q up -P -r MYBRANCH1 64 cvscall -Q update -P -r MYBRANCH1
50 echo bar > foo.txt 65 echo bar > foo.txt
51 cvscall -q ci -m "bar" | sed 's/.*,v.*/checking in/g' 66 cvsci -m "bar"
52 echo baz > foo.txt 67 echo baz > foo.txt
53 cvscall -q ci -m "baz" | sed 's/.*,v.*/checking in/g' 68 cvsci -m "baz"
54 69
70 echo "% create MYBRANCH1_2 and modify foo.txt some more"
55 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo 71 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
56 cvscall -q up -P -r MYBRANCH1_2 72 cvscall -Q update -P -r MYBRANCH1_2
57 73
58 echo bazzie > foo.txt 74 echo bazzie > foo.txt
59 cvscall -q ci -m "bazzie" | sed 's/.*,v.*/checking in/g' 75 cvsci -m "bazzie"
60 76
77 echo "% create MYBRANCH1_1 and modify foo.txt yet again"
61 cvscall -q rtag -b -R MYBRANCH1_1 foo 78 cvscall -q rtag -b -R MYBRANCH1_1 foo
62 cvscall -q up -P -r MYBRANCH1_1 79 cvscall -Q update -P -r MYBRANCH1_1
63 80
64 echo quux > foo.txt 81 echo quux > foo.txt
65 cvscall -q ci -m "quux" | sed 's/.*,v.*/checking in/g' 82 cvsci -m "quux"
66 cvscall -q up -P -jMYBRANCH1 | sed 's/RCS file: .*,v/merging MYBRANCH1/g' 83
84 echo "% merge MYBRANCH1 to MYBRANCH1_1"
85 filterpath cvscall -Q update -P -jMYBRANCH1
67 echo xyzzy > foo.txt 86 echo xyzzy > foo.txt
68 cvscall -q ci -m "merge" | sed 's/.*,v.*/checking in/g' 87 cvsci -m "merge1"
69 88
70 cvscall -q up -P -A 89 echo "% return to trunk and merge MYBRANCH1_2"
71 90 cvscall -Q update -P -A
72 cvscall -q up -P -jMYBRANCH1_2 | sed 's/RCS file: .*,v/merging MYBRANCH1_2/g' 91 filterpath cvscall -Q update -P -jMYBRANCH1_2
73 cvscall -q ci -m "merge" | sed 's/.*,v.*/checking in/g' 92 cvsci -m "merge2"
74 93
75 REALCVS=`which cvs` 94 REALCVS=`which cvs`
76 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 95 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
77 chmod +x cvs 96 chmod +x cvs
78 PATH=.:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/' 97 PATH=.:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'