annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8451
ec8b8a0f494b cvsnt-mergepoints test: use sh instead of bash
Martin Geisler <mg@lazybytes.net>
parents: 8350
diff changeset
1 #!/bin/sh
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
2
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
3 "$TESTDIR/hghave" cvs || exit 80
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
4
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
5 filterpath()
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
6 {
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
7 eval "$@" | sed "s:$CVSROOT:*REPO*:g"
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
8 }
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
9
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
10 cvscall()
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
11 {
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
12 echo cvs -f "$@"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
13 cvs -f "$@"
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
14 }
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
15
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
16 # output of 'cvs ci' varies unpredictably, so discard most of it
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
17 # -- just keep the part that matters
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
18 cvsci()
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
19 {
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
20 echo cvs -f ci "$@"
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
21 cvs -f ci "$@" 2>&1 | egrep "^(new|initial) revision:"
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
22 }
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
23
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
24 hgcat()
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
25 {
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
26 hg --cwd src-hg cat -r tip "$1"
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
27 }
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
28
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
29 echo "[extensions]" >> $HGRCPATH
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
30 echo "convert = " >> $HGRCPATH
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
31 echo "graphlog = " >> $HGRCPATH
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
32 echo "[convert]" >> $HGRCPATH
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
33 echo "cvsps=builtin" >> $HGRCPATH
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
34
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
35 echo "% create cvs repository"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
36 mkdir cvsmaster
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
37 cd cvsmaster
8350
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 7956
diff changeset
38 CVSROOT=`pwd`
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 7956
diff changeset
39 export CVSROOT
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 7956
diff changeset
40 CVS_OPTIONS=-f
1f0f01bc86a5 tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents: 7956
diff changeset
41 export CVS_OPTIONS
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
42 cd ..
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
43 filterpath cvscall -Q -d "$CVSROOT" init
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
44
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
45 echo "% checkout #1: add foo.txt"
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
46 cvscall -Q checkout -d cvsworktmp .
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
47 cd cvsworktmp
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
48 mkdir foo
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
49 cvscall -Q add foo
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
50 cd foo
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
51 echo foo > foo.txt
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
52 cvscall -Q add foo.txt
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
53 cvsci -m "foo.txt"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
54
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
55 cd ../..
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
56 rm -rf cvsworktmp
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
57
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
58 echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it"
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
59 cvscall -Q checkout -d cvswork foo
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
60
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
61 cd cvswork
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
62
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
63 cvscall -q rtag -b -R MYBRANCH1 foo
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
64 cvscall -Q update -P -r MYBRANCH1
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
65 echo bar > foo.txt
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
66 cvsci -m "bar"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
67 echo baz > foo.txt
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
68 cvsci -m "baz"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
69
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
70 echo "% create MYBRANCH1_2 and modify foo.txt some more"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
71 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
72 cvscall -Q update -P -r MYBRANCH1_2
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
73
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
74 echo bazzie > foo.txt
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
75 cvsci -m "bazzie"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
76
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
77 echo "% create MYBRANCH1_1 and modify foo.txt yet again"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
78 cvscall -q rtag -b -R MYBRANCH1_1 foo
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
79 cvscall -Q update -P -r MYBRANCH1_1
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
80
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
81 echo quux > foo.txt
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
82 cvsci -m "quux"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
83
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
84 echo "% merge MYBRANCH1 to MYBRANCH1_1"
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
85 filterpath cvscall -Q update -P -jMYBRANCH1
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
86 echo xyzzy > foo.txt
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
87 cvsci -m "merge1"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
88
8819
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
89 echo "% return to trunk and merge MYBRANCH1_2"
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
90 cvscall -Q update -P -A
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
91 filterpath cvscall -Q update -P -jMYBRANCH1_2
e93ab347c814 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents: 8818
diff changeset
92 cvsci -m "merge2"
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
93
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
94 REALCVS=`which cvs`
8818
727f7aaefaab Rename CVSNT "mergepoints" test and make it executable.
Greg Ward <greg-hg@gerg.ca>
parents: 8451
diff changeset
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
7956
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
96 chmod +x cvs
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
97 PATH=.:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
98
3e7611a83230 convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff changeset
99 cd ..