Show More
@@ -0,0 +1,108 b'' | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | # Test config convert.cvsps.mergefrom config setting. | |
|
4 | # (Should test similar mergeto feature, but I don't understand it yet.) | |
|
5 | # Requires builtin cvsps. | |
|
6 | ||
|
7 | "$TESTDIR/hghave" cvs || exit 80 | |
|
8 | ||
|
9 | export CVSROOT=`pwd`/cvsrepo | |
|
10 | ||
|
11 | # XXX copied from test-convert-cvs-synthetic | |
|
12 | cvscall() | |
|
13 | { | |
|
14 | echo cvs -f "$@" | |
|
15 | cvs -f "$@" | |
|
16 | } | |
|
17 | ||
|
18 | # output of 'cvs ci' varies unpredictably, so just discard it | |
|
19 | # XXX copied from test-convert-cvs-synthetic | |
|
20 | cvsci() | |
|
21 | { | |
|
22 | echo cvs -f ci "$@" | |
|
23 | cvs -f ci "$@" >/dev/null 2>&1 | |
|
24 | } | |
|
25 | ||
|
26 | # XXX copied from test-convert-cvs-synthetic | |
|
27 | filterpath() | |
|
28 | { | |
|
29 | eval "$@" | sed "s:$CVSROOT:*REPO*:g" | |
|
30 | } | |
|
31 | ||
|
32 | echo "[extensions]" >> $HGRCPATH | |
|
33 | echo "convert = " >> $HGRCPATH | |
|
34 | echo "[convert]" >> $HGRCPATH | |
|
35 | echo "cvsps=builtin" >> $HGRCPATH | |
|
36 | echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH | |
|
37 | ||
|
38 | echo % create cvs repository with one project | |
|
39 | mkdir cvsrepo | |
|
40 | ||
|
41 | filterpath cvscall -q -d "$CVSROOT" init | |
|
42 | mkdir cvsrepo/proj | |
|
43 | ||
|
44 | echo % populate cvs repository | |
|
45 | cvscall -Q co proj | |
|
46 | cd proj | |
|
47 | touch file1 | |
|
48 | cvscall -Q add file1 | |
|
49 | cvsci -m"add file1 on trunk" | |
|
50 | ||
|
51 | echo % create two release branches | |
|
52 | cvscall -q tag -b v1_0 | |
|
53 | cvscall -q tag -b v1_1 | |
|
54 | ||
|
55 | echo % modify file1 on branch v1_0 | |
|
56 | filterpath cvscall -Q update -rv1_0 | |
|
57 | echo "change" >> file1 | |
|
58 | cvsci -m"add text" | |
|
59 | ||
|
60 | echo % make unrelated change on v1_1 | |
|
61 | cvscall -Q update -rv1_1 | |
|
62 | touch unrelated | |
|
63 | cvscall -Q add unrelated | |
|
64 | cvsci -m"unrelated change" | |
|
65 | ||
|
66 | echo % merge file1 to v1_1 | |
|
67 | filterpath cvscall -Q update -jv1_0 | |
|
68 | cvsci -m"add text [MERGE from v1_0]" | |
|
69 | ||
|
70 | echo % merge change to trunk | |
|
71 | cvscall -Q update -A | |
|
72 | filterpath cvscall -Q update -jv1_1 | |
|
73 | cvsci -m"add text [MERGE from v1_1]" | |
|
74 | ||
|
75 | echo % non-merged change on trunk | |
|
76 | echo "foo" > file2 | |
|
77 | cvscall -Q add file2 | |
|
78 | cvsci -m"add file2 on trunk" file2 | |
|
79 | ||
|
80 | # this will create rev 1.3 | |
|
81 | echo % change on trunk to backport | |
|
82 | echo "backport me" >> file1 | |
|
83 | cvsci -m"add other text" file1 | |
|
84 | cvscall log file1 | sed -n '/^date: / d; /^revision /,$ p;' | |
|
85 | ||
|
86 | # XXX how many ways are there to spell "trunk" with CVS? | |
|
87 | echo % backport trunk change to v1_1 | |
|
88 | cvscall -Q update -rv1_1 | |
|
89 | filterpath cvscall -Q update -j1.2 -j1.3 file1 | |
|
90 | cvsci -m"add other text [MERGE from HEAD]" file1 | |
|
91 | ||
|
92 | set -e | |
|
93 | echo % convert to hg | |
|
94 | cd .. | |
|
95 | filterpath hg convert proj proj.hg | |
|
96 | ||
|
97 | echo % complete log | |
|
98 | template="{rev}: '{branches}' {desc}\n" | |
|
99 | hg -R proj.hg log --template="$template" | |
|
100 | ||
|
101 | echo % parents of rev 3 | |
|
102 | hg -R proj.hg parents --template="$template" -r3 | |
|
103 | echo % parents of rev 4 | |
|
104 | hg -R proj.hg parents --template="$template" -r4 | |
|
105 | echo % parents of rev 5 | |
|
106 | hg -R proj.hg parents --template="$template" -r5 | |
|
107 | echo % parents of rev 7 | |
|
108 | hg -R proj.hg parents --template="$template" -r7 |
@@ -0,0 +1,101 b'' | |||
|
1 | % create cvs repository with one project | |
|
2 | cvs -f -q -d *REPO* init | |
|
3 | % populate cvs repository | |
|
4 | cvs -f -Q co proj | |
|
5 | cvs -f -Q add file1 | |
|
6 | cvs -f ci -madd file1 on trunk | |
|
7 | % create two release branches | |
|
8 | cvs -f -q tag -b v1_0 | |
|
9 | T file1 | |
|
10 | cvs -f -q tag -b v1_1 | |
|
11 | T file1 | |
|
12 | % modify file1 on branch v1_0 | |
|
13 | cvs -f -Q update -rv1_0 | |
|
14 | cvs -f ci -madd text | |
|
15 | % make unrelated change on v1_1 | |
|
16 | cvs -f -Q update -rv1_1 | |
|
17 | cvs -f -Q add unrelated | |
|
18 | cvs -f ci -munrelated change | |
|
19 | % merge file1 to v1_1 | |
|
20 | cvs -f -Q update -jv1_0 | |
|
21 | RCS file: *REPO*/proj/file1,v | |
|
22 | retrieving revision 1.1 | |
|
23 | retrieving revision 1.1.2.1 | |
|
24 | Merging differences between 1.1 and 1.1.2.1 into file1 | |
|
25 | cvs -f ci -madd text [MERGE from v1_0] | |
|
26 | % merge change to trunk | |
|
27 | cvs -f -Q update -A | |
|
28 | cvs -f -Q update -jv1_1 | |
|
29 | RCS file: *REPO*/proj/file1,v | |
|
30 | retrieving revision 1.1 | |
|
31 | retrieving revision 1.1.4.1 | |
|
32 | Merging differences between 1.1 and 1.1.4.1 into file1 | |
|
33 | cvs -f ci -madd text [MERGE from v1_1] | |
|
34 | % non-merged change on trunk | |
|
35 | cvs -f -Q add file2 | |
|
36 | cvs -f ci -madd file2 on trunk file2 | |
|
37 | % change on trunk to backport | |
|
38 | cvs -f ci -madd other text file1 | |
|
39 | revision 1.3 | |
|
40 | add other text | |
|
41 | ---------------------------- | |
|
42 | revision 1.2 | |
|
43 | add text [MERGE from v1_1] | |
|
44 | ---------------------------- | |
|
45 | revision 1.1 | |
|
46 | branches: 1.1.2; 1.1.4; | |
|
47 | add file1 on trunk | |
|
48 | ---------------------------- | |
|
49 | revision 1.1.4.1 | |
|
50 | add text [MERGE from v1_0] | |
|
51 | ---------------------------- | |
|
52 | revision 1.1.2.1 | |
|
53 | add text | |
|
54 | ============================================================================= | |
|
55 | % backport trunk change to v1_1 | |
|
56 | cvs -f -Q update -rv1_1 | |
|
57 | cvs -f -Q update -j1.2 -j1.3 file1 | |
|
58 | RCS file: *REPO*/proj/file1,v | |
|
59 | retrieving revision 1.2 | |
|
60 | retrieving revision 1.3 | |
|
61 | Merging differences between 1.2 and 1.3 into file1 | |
|
62 | cvs -f ci -madd other text [MERGE from HEAD] file1 | |
|
63 | % convert to hg | |
|
64 | initializing destination proj.hg repository | |
|
65 | connecting to *REPO* | |
|
66 | scanning source... | |
|
67 | using builtin cvsps | |
|
68 | collecting CVS rlog | |
|
69 | 10 log entries | |
|
70 | creating changesets | |
|
71 | 8 changeset entries | |
|
72 | sorting... | |
|
73 | converting... | |
|
74 | 7 add file1 on trunk | |
|
75 | 6 add text | |
|
76 | 5 unrelated change | |
|
77 | 4 add text [MERGE from v1_0] | |
|
78 | 3 add text [MERGE from v1_1] | |
|
79 | 2 add file2 on trunk | |
|
80 | 1 add other text | |
|
81 | 0 add other text [MERGE from HEAD] | |
|
82 | % complete log | |
|
83 | 7: 'v1_1' add other text [MERGE from HEAD] | |
|
84 | 6: '' add other text | |
|
85 | 5: '' add file2 on trunk | |
|
86 | 4: '' add text [MERGE from v1_1] | |
|
87 | 3: 'v1_1' add text [MERGE from v1_0] | |
|
88 | 2: 'v1_1' unrelated change | |
|
89 | 1: 'v1_0' add text | |
|
90 | 0: '' add file1 on trunk | |
|
91 | % parents of rev 3 | |
|
92 | 2: 'v1_1' unrelated change | |
|
93 | 1: 'v1_0' add text | |
|
94 | % parents of rev 4 | |
|
95 | 0: '' add file1 on trunk | |
|
96 | 3: 'v1_1' add text [MERGE from v1_0] | |
|
97 | % parents of rev 5 | |
|
98 | 4: '' add text [MERGE from v1_1] | |
|
99 | % parents of rev 7 | |
|
100 | 3: 'v1_1' add text [MERGE from v1_0] | |
|
101 | 6: '' add other text |
General Comments 0
You need to be logged in to leave comments.
Login now