summaryrefslogtreecommitdiff
path: root/t/t9801-git-p4-branch.sh
diff options
context:
space:
mode:
authorVitor Antunes <vitor.hda@gmail.com>2012-05-26 10:56:04 +0100
committerJunio C Hamano <gitster@pobox.com>2012-05-29 10:45:59 -0700
commit9e826dfd57cb6f8d2a2f78c42b8153724dc2ea0e (patch)
tree8f171cf13eb0e31f9f6b4bd5408f225142228ba7 /t/t9801-git-p4-branch.sh
parent6ab1d76c3cf96aac77a75565dfaa0cf64aa100a1 (diff)
downloadgit-9e826dfd57cb6f8d2a2f78c42b8153724dc2ea0e.tar.gz
git-p4: Test changelists touching two branches
It is possible to modify two different branches in P4 in a single changelist. git-p4 correctly detects this and commits the relevant changes to the different branches separately. This test proves that and avoid future regressions in this behavior. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9801-git-p4-branch.sh')
-rwxr-xr-xt/t9801-git-p4-branch.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index 2859256de3..0ae86075f1 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -306,6 +306,58 @@ test_expect_success 'git p4 clone complex branches' '
)
'
+# Move branch3/file3 to branch4/file3 in a single changelist
+test_expect_success 'git p4 submit to two branches in a single changelist' '
+ (
+ cd "$cli" &&
+ p4 integrate //depot/branch3/file3 //depot/branch4/file3 &&
+ p4 delete //depot/branch3/file3 &&
+ p4 submit -d "Move branch3/file3 to branch4/file3"
+ )
+'
+
+# Confirm that changes to two branches done in a single changelist
+# are correctly imported by git p4
+test_expect_success 'git p4 sync changes to two branches in the same changelist' '
+ test_when_finished cleanup_git &&
+ test_create_repo "$git" &&
+ (
+ cd "$git" &&
+ git config git-p4.branchList branch1:branch2 &&
+ git config --add git-p4.branchList branch1:branch3 &&
+ git config --add git-p4.branchList branch1:branch4 &&
+ git config --add git-p4.branchList branch1:branch5 &&
+ git p4 clone --dest=. --detect-branches //depot@all &&
+ git log --all --graph --decorate --stat &&
+ git reset --hard p4/depot/branch1 &&
+ test_path_is_file file1 &&
+ test_path_is_file file2 &&
+ test_path_is_file file3 &&
+ grep update file2 &&
+ git reset --hard p4/depot/branch2 &&
+ test_path_is_file file1 &&
+ test_path_is_file file2 &&
+ test_path_is_missing file3 &&
+ ! grep update file2 &&
+ git reset --hard p4/depot/branch3 &&
+ test_path_is_file file1 &&
+ test_path_is_file file2 &&
+ test_path_is_missing file3 &&
+ grep update file2 &&
+ git reset --hard p4/depot/branch4 &&
+ test_path_is_file file1 &&
+ test_path_is_file file2 &&
+ test_path_is_file file3 &&
+ ! grep update file2 &&
+ git reset --hard p4/depot/branch5 &&
+ test_path_is_file file1 &&
+ test_path_is_file file2 &&
+ test_path_is_file file3 &&
+ ! grep update file2 &&
+ test_path_is_missing .git/git-p4-tmp
+ )
+'
+
test_expect_success 'kill p4d' '
kill_p4d
'