3 test_description
='git p4 label tests'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'start p4d' '
12 # Basic p4 label tests.
14 # Note: can't have more than one label per commit - others
15 # are silently discarded.
17 test_expect_success
'basic p4 labels' '
18 test_when_finished cleanup_git &&
25 p4 submit -d "main/f1" &&
29 p4 submit -d "main/f2" &&
31 echo f3 >main/file_with_\$metachar &&
32 p4 add main/file_with_\$metachar &&
33 p4 submit -d "file with metachar" &&
35 p4 tag -l tag_f1_only main/f1 &&
36 p4 tag -l tag_with\$_shell_char main/... &&
40 p4 submit -d "main/f4" &&
50 p4 tag -l long_label ... &&
54 git p4 clone --dest="$git" --detect-labels //depot@all &&
59 test_line_count = 3 taglist &&
62 git checkout tag_tag_f1_only &&
64 git checkout tag_tag_with\$_shell_char &&
65 test -f f1 && test -f f2 && test -f file_with_\$metachar &&
67 git show tag_long_label | grep -q "A Label second line"
71 # Test some label corner cases:
73 # - two tags on the same file; both should be available
74 # - a tag that is only on one file; this kind of tag
75 # cannot be imported (at least not easily).
77 test_expect_failure
'two labels on the same changelist' '
78 test_when_finished cleanup_git &&
83 p4 edit main/f1 main/f2 &&
84 echo "hello world" >main/f1 &&
85 echo "not in the tag" >main/f2 &&
86 p4 submit -d "main/f[12]: testing two labels" &&
88 p4 tag -l tag_f1_1 main/... &&
89 p4 tag -l tag_f1_2 main/... &&
93 git p4 clone --dest="$git" --detect-labels //depot@all &&
96 git tag | grep tag_f1 &&
97 git tag | grep -q tag_f1_1 &&
98 git tag | grep -q tag_f1_2 &&
102 git checkout tag_tag_f1_1 &&
106 git checkout tag_tag_f1_2 &&