3 test_description
='git-p4 p4 label tests'
7 test_expect_success
'start p4d' '
11 # Basic p4 label tests.
13 # Note: can't have more than one label per commit - others
14 # are silently discarded.
16 test_expect_success
'basic p4 labels' '
17 test_when_finished cleanup_git &&
24 p4 submit -d "main/f1" &&
28 p4 submit -d "main/f2" &&
30 echo f3 >main/file_with_\$metachar &&
31 p4 add main/file_with_\$metachar &&
32 p4 submit -d "file with metachar" &&
34 p4 tag -l tag_f1_only main/f1 &&
35 p4 tag -l tag_with\$_shell_char main/... &&
39 p4 submit -d "main/f4" &&
49 p4 tag -l long_label ... &&
53 "$GITP4" clone --dest="$git" --detect-labels //depot@all &&
58 test_line_count = 3 taglist &&
61 git checkout tag_tag_f1_only &&
63 git checkout tag_tag_with\$_shell_char &&
64 test -f f1 && test -f f2 && test -f file_with_\$metachar &&
66 git show tag_long_label | grep -q "A Label second line"
70 # Test some label corner cases:
72 # - two tags on the same file; both should be available
73 # - a tag that is only on one file; this kind of tag
74 # cannot be imported (at least not easily).
76 test_expect_failure
'two labels on the same changelist' '
77 test_when_finished cleanup_git &&
82 p4 edit main/f1 main/f2 &&
83 echo "hello world" >main/f1 &&
84 echo "not in the tag" >main/f2 &&
85 p4 submit -d "main/f[12]: testing two labels" &&
87 p4 tag -l tag_f1_1 main/... &&
88 p4 tag -l tag_f1_2 main/... &&
92 "$GITP4" clone --dest="$git" --detect-labels //depot@all &&
95 git tag | grep tag_f1 &&
96 git tag | grep -q tag_f1_1 &&
97 git tag | grep -q tag_f1_2 &&
101 git checkout tag_tag_f1_1 &&
105 git checkout tag_tag_f1_2 &&
111 test_expect_success
'kill p4d' '