1test_description='git-p4 p4 label tests'23. ./lib-git-p4.sh45test_expect_success 'start p4d' '6start_p4d7'89# Basic p4 label tests.10#11# Note: can't have more than one label per commit - others12# are silently discarded.13#14test_expect_success 'basic p4 labels' '15test_when_finished cleanup_git &&16(17cd "$cli" &&18mkdir -p main &&1920echo f1 >main/f1 &&21p4 add main/f1 &&22p4 submit -d "main/f1" &&2324echo f2 >main/f2 &&25p4 add main/f2 &&26p4 submit -d "main/f2" &&2728echo f3 >main/file_with_\$metachar &&29p4 add main/file_with_\$metachar &&30p4 submit -d "file with metachar" &&3132p4 tag -l tag_f1_only main/f1 &&33p4 tag -l tag_with\$_shell_char main/... &&3435echo f4 >main/f4 &&36p4 add main/f4 &&37p4 submit -d "main/f4" &&3839p4 label -i <<-EOF &&40Label: long_label41Description:42A Label first line43A Label second line44View: //depot/...45EOF4647p4 tag -l long_label ... &&4849p4 labels ... &&5051"$GITP4" clone --dest="$git" --detect-labels //depot@all &&52cd "$git" &&5354git tag &&55git tag >taglist &&56test_line_count = 3 taglist &&5758cd main &&59git checkout tag_tag_f1_only &&60! test -f f2 &&61git checkout tag_tag_with\$_shell_char &&62test -f f1 && test -f f2 && test -f file_with_\$metachar &&6364git show tag_long_label | grep -q "A Label second line"65)66'6768# Test some label corner cases:69#70# - two tags on the same file; both should be available71# - a tag that is only on one file; this kind of tag72# cannot be imported (at least not easily).7374test_expect_failure 'two labels on the same changelist' '75test_when_finished cleanup_git &&76(77cd "$cli" &&78mkdir -p main &&7980p4 edit main/f1 main/f2 &&81echo "hello world" >main/f1 &&82echo "not in the tag" >main/f2 &&83p4 submit -d "main/f[12]: testing two labels" &&8485p4 tag -l tag_f1_1 main/... &&86p4 tag -l tag_f1_2 main/... &&8788p4 labels ... &&8990"$GITP4" clone --dest="$git" --detect-labels //depot@all &&91cd "$git" &&9293git tag | grep tag_f1 &&94git tag | grep -q tag_f1_1 &&95git tag | grep -q tag_f1_2 &&9697cd main &&9899git checkout tag_tag_f1_1 &&100ls &&101test -f f1 &&102103git checkout tag_tag_f1_2 &&104ls &&105test -f f1106)107'108109test_expect_success 'kill p4d' '110kill_p4d111'112113test_done