Skip to content

Commit 0dc0621

Browse files
mhaggergitster
authored andcommitted
Add a test of "git cvsimport"'s handling of tags and branches
6 out of 11 of these tests fail. The test CVS repository used for these tests is derived from one in cvs2svn's test suite. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b225290 commit 0dc0621

File tree

12 files changed

+921
-0
lines changed

12 files changed

+921
-0
lines changed

t/t9602-cvsimport-branches-tags.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/sh
2+
3+
# A description of the repository used for this test can be found in
4+
# t9602/README.
5+
6+
test_description='git cvsimport handling of branches and tags'
7+
. ./lib-cvs.sh
8+
9+
CVSROOT="$TEST_DIRECTORY"/t9602/cvsroot
10+
export CVSROOT
11+
12+
test_expect_success 'import module' '
13+
14+
git cvsimport -C module-git module
15+
16+
'
17+
18+
test_expect_success 'test branch master' '
19+
20+
test_cmp_branch_tree master
21+
22+
'
23+
24+
test_expect_success 'test branch vendorbranch' '
25+
26+
test_cmp_branch_tree vendorbranch
27+
28+
'
29+
30+
test_expect_failure 'test branch B_FROM_INITIALS' '
31+
32+
test_cmp_branch_tree B_FROM_INITIALS
33+
34+
'
35+
36+
test_expect_failure 'test branch B_FROM_INITIALS_BUT_ONE' '
37+
38+
test_cmp_branch_tree B_FROM_INITIALS_BUT_ONE
39+
40+
'
41+
42+
test_expect_failure 'test branch B_MIXED' '
43+
44+
test_cmp_branch_tree B_MIXED
45+
46+
'
47+
48+
test_expect_success 'test branch B_SPLIT' '
49+
50+
test_cmp_branch_tree B_SPLIT
51+
52+
'
53+
54+
test_expect_failure 'test tag vendortag' '
55+
56+
test_cmp_branch_tree vendortag
57+
58+
'
59+
60+
test_expect_success 'test tag T_ALL_INITIAL_FILES' '
61+
62+
test_cmp_branch_tree T_ALL_INITIAL_FILES
63+
64+
'
65+
66+
test_expect_failure 'test tag T_ALL_INITIAL_FILES_BUT_ONE' '
67+
68+
test_cmp_branch_tree T_ALL_INITIAL_FILES_BUT_ONE
69+
70+
'
71+
72+
test_expect_failure 'test tag T_MIXED' '
73+
74+
test_cmp_branch_tree T_MIXED
75+
76+
'
77+
78+
79+
test_done

t/t9602/README

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
This repository is for testing the ability to group revisions
2+
correctly along tags and branches. Here is its history:
3+
4+
1. The initial import (revision 1.1 of everybody) created a
5+
directory structure with a file named `default' in each dir:
6+
7+
./
8+
default
9+
sub1/default
10+
subsubA/default
11+
subsubB/default
12+
sub2/default
13+
subsubA/default
14+
sub3/default
15+
16+
2. Then tagged everyone with T_ALL_INITIAL_FILES.
17+
18+
3. Then tagged everyone except sub1/subsubB/default with
19+
T_ALL_INITIAL_FILES_BUT_ONE.
20+
21+
4. Then created branch B_FROM_INITIALS on everyone.
22+
23+
5. Then created branch B_FROM_INITIALS_BUT_ONE on everyone except
24+
/sub1/subsubB/default.
25+
26+
6. Then committed modifications to two files: sub3/default, and
27+
sub1/subsubA/default.
28+
29+
7. Then committed a modification to all 7 files.
30+
31+
8. Then backdated sub3/default to revision 1.2, and
32+
sub2/subsubA/default to revision 1.1, and tagged with T_MIXED.
33+
34+
9. Same as 8, but tagged with -b to create branch B_MIXED.
35+
36+
10. Switched the working copy to B_MIXED, and added
37+
sub2/branch_B_MIXED_only. (That's why the RCS file is in
38+
sub2/Attic/ -- it never existed on trunk.)
39+
40+
11. In one commit, modified default, sub1/default, and
41+
sub2/subsubA/default, on branch B_MIXED.
42+
43+
12. Did "cvs up -A" on sub2/default, then in one commit, made a
44+
change to sub2/default and sub2/branch_B_MIXED_only. So this
45+
commit should be spread between the branch and the trunk.
46+
47+
13. Do "cvs up -A" to get everyone back to trunk, then make a new
48+
branch B_SPLIT on everyone except sub1/subsubB/default,v.
49+
50+
14. Switch to branch B_SPLIT (see sub1/subsubB/default disappear)
51+
and commit a change that affects everyone except sub3/default.
52+
53+
15. An hour or so later, "cvs up -A" to get sub1/subsubB/default
54+
back, then commit a change on that file, on trunk. (It's
55+
important that this change happened after the previous commits
56+
on B_SPLIT.)
57+
58+
16. Branch sub1/subsubB/default to B_SPLIT, then "cvs up -r B_SPLIT"
59+
to switch the whole working copy to the branch.
60+
61+
17. Commit a change on B_SPLIT, to sub1/subsubB/default and
62+
sub3/default.

t/t9602/cvsroot/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -whitespace

t/t9602/cvsroot/CVSROOT/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
history
2+
val-tags

t/t9602/cvsroot/module/default,v

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
head 1.2;
2+
access;
3+
symbols
4+
B_SPLIT:1.2.0.4
5+
B_MIXED:1.2.0.2
6+
T_MIXED:1.2
7+
B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
8+
B_FROM_INITIALS:1.1.1.1.0.2
9+
T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
10+
T_ALL_INITIAL_FILES:1.1.1.1
11+
vendortag:1.1.1.1
12+
vendorbranch:1.1.1;
13+
locks; strict;
14+
comment @# @;
15+
16+
17+
1.2
18+
date 2003.05.23.00.17.53; author jrandom; state Exp;
19+
branches
20+
1.2.2.1
21+
1.2.4.1;
22+
next 1.1;
23+
24+
1.1
25+
date 2003.05.22.23.20.19; author jrandom; state Exp;
26+
branches
27+
1.1.1.1;
28+
next ;
29+
30+
1.1.1.1
31+
date 2003.05.22.23.20.19; author jrandom; state Exp;
32+
branches;
33+
next ;
34+
35+
1.2.2.1
36+
date 2003.05.23.00.31.36; author jrandom; state Exp;
37+
branches;
38+
next ;
39+
40+
1.2.4.1
41+
date 2003.06.03.03.20.31; author jrandom; state Exp;
42+
branches;
43+
next ;
44+
45+
46+
desc
47+
@@
48+
49+
50+
1.2
51+
log
52+
@Second commit to proj, affecting all 7 files.
53+
@
54+
text
55+
@This is the file `default' in the top level of the project.
56+
57+
Every directory in the `proj' project has a file named `default'.
58+
59+
This line was added in the second commit (affecting all 7 files).
60+
@
61+
62+
63+
1.2.4.1
64+
log
65+
@First change on branch B_SPLIT.
66+
67+
This change excludes sub3/default, because it was not part of this
68+
commit, and sub1/subsubB/default, which is not even on the branch yet.
69+
@
70+
text
71+
@a5 2
72+
73+
First change on branch B_SPLIT.
74+
@
75+
76+
77+
1.2.2.1
78+
log
79+
@Modify three files, on branch B_MIXED.
80+
@
81+
text
82+
@a5 2
83+
84+
This line was added on branch B_MIXED only (affecting 3 files).
85+
@
86+
87+
88+
1.1
89+
log
90+
@Initial revision
91+
@
92+
text
93+
@d4 2
94+
@
95+
96+
97+
1.1.1.1
98+
log
99+
@Initial import.
100+
@
101+
text
102+
@@
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
head 1.2;
2+
access;
3+
symbols
4+
B_SPLIT:1.2.0.4
5+
B_MIXED:1.2.0.2
6+
T_MIXED:1.2
7+
B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
8+
B_FROM_INITIALS:1.1.1.1.0.2
9+
T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
10+
T_ALL_INITIAL_FILES:1.1.1.1
11+
vendortag:1.1.1.1
12+
vendorbranch:1.1.1;
13+
locks; strict;
14+
comment @# @;
15+
16+
17+
1.2
18+
date 2003.05.23.00.17.53; author jrandom; state Exp;
19+
branches
20+
1.2.2.1
21+
1.2.4.1;
22+
next 1.1;
23+
24+
1.1
25+
date 2003.05.22.23.20.19; author jrandom; state Exp;
26+
branches
27+
1.1.1.1;
28+
next ;
29+
30+
1.1.1.1
31+
date 2003.05.22.23.20.19; author jrandom; state Exp;
32+
branches;
33+
next ;
34+
35+
1.2.2.1
36+
date 2003.05.23.00.31.36; author jrandom; state Exp;
37+
branches;
38+
next ;
39+
40+
1.2.4.1
41+
date 2003.06.03.03.20.31; author jrandom; state Exp;
42+
branches;
43+
next ;
44+
45+
46+
desc
47+
@@
48+
49+
50+
1.2
51+
log
52+
@Second commit to proj, affecting all 7 files.
53+
@
54+
text
55+
@This is sub1/default.
56+
57+
Every directory in the `proj' project has a file named `default'.
58+
59+
This line was added in the second commit (affecting all 7 files).
60+
@
61+
62+
63+
1.2.4.1
64+
log
65+
@First change on branch B_SPLIT.
66+
67+
This change excludes sub3/default, because it was not part of this
68+
commit, and sub1/subsubB/default, which is not even on the branch yet.
69+
@
70+
text
71+
@a5 2
72+
73+
First change on branch B_SPLIT.
74+
@
75+
76+
77+
1.2.2.1
78+
log
79+
@Modify three files, on branch B_MIXED.
80+
@
81+
text
82+
@a5 2
83+
84+
This line was added on branch B_MIXED only (affecting 3 files).
85+
@
86+
87+
88+
1.1
89+
log
90+
@Initial revision
91+
@
92+
text
93+
@d4 2
94+
@
95+
96+
97+
1.1.1.1
98+
log
99+
@Initial import.
100+
@
101+
text
102+
@@

0 commit comments

Comments
 (0)