{"thread":{"id":"30628","subject":"[PATCHv2 0/3] New test cases for branch detection","startedAt":"2012-05-26T09:56:03Z","lastAt":"2012-05-26T14:00:18Z","messageCount":5,"participants":["Vitor Antunes","Pete Wyckoff"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"192227","messageId":"1338026166-5462-1-git-send-email-vitor.hda@gmail.com","threadId":"30628","inReplyTo":null,"subject":"[PATCHv2 0/3] New test cases for branch detection","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2012-05-26T09:56:03Z","receivedAt":"2012-05-26T09:56:03Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Updates for previous patch according to feedback from Pete Wyckoff (and\nsome help from Junio). I also tried to find more improvement\nopportunities and included an extra small patch with two small fixes.\n\nPlease review and provide feedback.\n\nKind regards.\n\nVitor Antunes (3):\n  git-p4: Test changelists touching two branches\n  git-p4: Verify detection of \"empty\" branch creation\n  git-p4: Clean up branch test cases\n\n t/t9801-git-p4-branch.sh |  110 ++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 107 insertions(+), 3 deletions(-)\n\n-- \n1.7.7.rc2.14.g5e044.dirty\n"},{"id":"192230","messageId":"1338026166-5462-2-git-send-email-vitor.hda@gmail.com","threadId":"30628","inReplyTo":"1338026166-5462-1-git-send-email-vitor.hda@gmail.com","subject":"[PATCHv2 1/3] git-p4: Test changelists touching two branches","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2012-05-26T09:56:04Z","receivedAt":"2012-05-26T09:56:04Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"It is possible to modify two different branches in P4 in a single\nchangelist. git-p4 correctly detects this and commits the relevant\nchanges to the different branches separately. This test proves that and\navoid future regressions in this behavior.\n\nSigned-off-by: Vitor Antunes <vitor.hda@gmail.com>\n---\n t/t9801-git-p4-branch.sh |   52 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 52 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh\nindex 2859256..0ae8607 100755\n--- a/t/t9801-git-p4-branch.sh\n+++ b/t/t9801-git-p4-branch.sh\n@@ -306,6 +306,58 @@ test_expect_success 'git p4 clone complex branches' '\n \t)\n '\n \n+# Move branch3/file3 to branch4/file3 in a single changelist\n+test_expect_success 'git p4 submit to two branches in a single changelist' '\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 integrate //depot/branch3/file3 //depot/branch4/file3 &&\n+\t\tp4 delete //depot/branch3/file3 &&\n+\t\tp4 submit -d \"Move branch3/file3 to branch4/file3\"\n+\t)\n+'\n+\n+# Confirm that changes to two branches done in a single changelist\n+# are correctly imported by git p4\n+test_expect_success 'git p4 sync changes to two branches in the same changelist' '\n+\ttest_when_finished cleanup_git &&\n+\ttest_create_repo \"$git\" &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit config git-p4.branchList branch1:branch2 &&\n+\t\tgit config --add git-p4.branchList branch1:branch3 &&\n+\t\tgit config --add git-p4.branchList branch1:branch4 &&\n+\t\tgit config --add git-p4.branchList branch1:branch5 &&\n+\t\tgit p4 clone --dest=. --detect-branches //depot@all &&\n+\t\tgit log --all --graph --decorate --stat &&\n+\t\tgit reset --hard p4/depot/branch1 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\tgrep update file2 &&\n+\t\tgit reset --hard p4/depot/branch2 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_missing file3 &&\n+\t\t! grep update file2 &&\n+\t\tgit reset --hard p4/depot/branch3 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_missing file3 &&\n+\t\tgrep update file2 &&\n+\t\tgit reset --hard p4/depot/branch4 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\t! grep update file2 &&\n+\t\tgit reset --hard p4/depot/branch5 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\t! grep update file2 &&\n+\t\ttest_path_is_missing .git/git-p4-tmp\n+\t)\n+'\n+\n test_expect_success 'kill p4d' '\n \tkill_p4d\n '\n-- \n1.7.7.rc2.14.g5e044.dirty\n"},{"id":"192229","messageId":"1338026166-5462-3-git-send-email-vitor.hda@gmail.com","threadId":"30628","inReplyTo":"1338026166-5462-1-git-send-email-vitor.hda@gmail.com","subject":"[PATCHv2 2/3] git-p4: Verify detection of \"empty\" branch creation","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2012-05-26T09:56:05Z","receivedAt":"2012-05-26T09:56:05Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Current implementation of new branch parent detection works on the\nprinciple that the new branch is a complete integration, with no\nchanges, of the original files.\nThis test shows this deficiency in the particular case when the new\nbranch is created from a subset of the original files.\n\nSigned-off-by: Vitor Antunes <vitor.hda@gmail.com>\n---\n t/t9801-git-p4-branch.sh |   54 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 54 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh\nindex 0ae8607..308b123 100755\n--- a/t/t9801-git-p4-branch.sh\n+++ b/t/t9801-git-p4-branch.sh\n@@ -358,6 +358,60 @@ test_expect_success 'git p4 sync changes to two branches in the same changelist'\n \t)\n '\n \n+# Create a branch by integrating a single file\n+test_expect_success 'git p4 file subset branch' '\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tp4 integrate //depot/branch1/file1 //depot/branch6/file1 &&\n+\t\tp4 submit -d \"Integrate file1 alone from branch1 to branch6\"\n+\t)\n+'\n+\n+# Check if git p4 creates a new branch containing a single file,\n+# instead of keeping the old files from the original branch\n+test_expect_failure 'git p4 clone file subset branch' '\n+\ttest_when_finished cleanup_git &&\n+\ttest_create_repo \"$git\" &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit config git-p4.branchList branch1:branch2 &&\n+\t\tgit config --add git-p4.branchList branch1:branch3 &&\n+\t\tgit config --add git-p4.branchList branch1:branch4 &&\n+\t\tgit config --add git-p4.branchList branch1:branch5 &&\n+\t\tgit config --add git-p4.branchList branch1:branch6 &&\n+\t\tgit p4 clone --dest=. --detect-branches //depot@all &&\n+\t\tgit log --all --graph --decorate --stat &&\n+\t\tgit reset --hard p4/depot/branch1 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\tgrep update file2 &&\n+\t\tgit reset --hard p4/depot/branch2 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_missing file3 &&\n+\t\t! grep update file2 &&\n+\t\tgit reset --hard p4/depot/branch3 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_missing file3 &&\n+\t\tgrep update file2 &&\n+\t\tgit reset --hard p4/depot/branch4 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\t! grep update file2 &&\n+\t\tgit reset --hard p4/depot/branch5 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\t! grep update file2 &&\n+\t\tgit reset --hard p4/depot/branch6 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_missing file2 &&\n+\t\ttest_path_is_missing file3\n+\t)\n+'\n test_expect_success 'kill p4d' '\n \tkill_p4d\n '\n-- \n1.7.7.rc2.14.g5e044.dirty\n"},{"id":"192228","messageId":"1338026166-5462-4-git-send-email-vitor.hda@gmail.com","threadId":"30628","inReplyTo":"1338026166-5462-1-git-send-email-vitor.hda@gmail.com","subject":"[PATCHv2 3/3] git-p4: Clean up branch test cases","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2012-05-26T09:56:06Z","receivedAt":"2012-05-26T09:56:06Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Correct submit description in one test and remove not required commands\nfrom another.\n\nSigned-off-by: Vitor Antunes <vitor.hda@gmail.com>\n---\n t/t9801-git-p4-branch.sh |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh\nindex 308b123..99fe16b 100755\n--- a/t/t9801-git-p4-branch.sh\n+++ b/t/t9801-git-p4-branch.sh\n@@ -218,7 +218,7 @@ test_expect_success 'git p4 clone simple branches' '\n \t\tcd branch1 &&\n \t\tp4 edit file2 &&\n \t\techo file2_ >>file2 &&\n-\t\tp4 submit -d \"update file2 in branch3\" &&\n+\t\tp4 submit -d \"update file2 in branch1\" &&\n \t\tcd \"$git\" &&\n \t\tgit reset --hard p4/depot/branch1 &&\n \t\tgit p4 rebase &&\n@@ -249,8 +249,6 @@ test_expect_success 'git p4 clone simple branches' '\n #   `- file2\n #   `- file3\n test_expect_success 'git p4 add complex branches' '\n-\ttest_when_finished cleanup_git &&\n-\ttest_create_repo \"$git\" &&\n \t(\n \t\tcd \"$cli\" &&\n \t\tchangelist=$(p4 changes -m1 //depot/... | cut -d\" \" -f2) &&\n-- \n1.7.7.rc2.14.g5e044.dirty\n"},{"id":"192244","messageId":"20120526140018.GA28962@padd.com","threadId":"30628","inReplyTo":"1338026166-5462-1-git-send-email-vitor.hda@gmail.com","subject":"Re: [PATCHv2 0/3] New test cases for branch detection","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-05-26T14:00:18Z","receivedAt":"2012-05-26T14:00:18Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"vitor.hda@gmail.com wrote on Sat, 26 May 2012 10:56 +0100:\n> Updates for previous patch according to feedback from Pete Wyckoff (and\n> some help from Junio). I also tried to find more improvement\n> opportunities and included an extra small patch with two small fixes.\n> \n> Please review and provide feedback.\n\nThese all look great to me, including the new fixes.\n\nAcked-by: Pete Wyckoff <pw@padd.com>\n\n\t\t-- Pete\n"}]}