summaryrefslogtreecommitdiff
path: root/t/t9801-git-p4-branch.sh
AgeCommit message (Collapse)AuthorFilesLines
2015-04-23git-p4: improve client path detection when branches are usedLibravatar Vitor Antunes1-1/+1
Perforce allows client side file/directory remapping through the use of the client view definition that is part of the user's client spec. To support this functionality while branch detection is enabled it is important to determine the branch location in the workspace such that the correct files are patched before Perforce submission. Perforce provides a command that facilitates this process: p4 where. This patch does two things to fix improve file location detection when git-p4 has branch detection and use of client spec enabled: 1. Enable usage of "p4 where" when Perforce branches exist in the git repository, even when client specification is used. This makes use of the already existing function p4Where. 2. Allow identifying partial matches of the branch's depot path while processing the output of "p4 where". For robustness, paths will only match if ending in "/...". Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-04-22t9801: check git-p4's branch detection with client spec enabledLibravatar Vitor Antunes1-0/+106
Add failing scenario when branch detection (--detect-branches) is enabled together with use client spec (--use-client-spec). In this specific scenario git-p4 will break when the Perforce client view removes part of the depot path, as in the following example: //depot/branch1/base/... //client/branch1/... The test case also includes an extra sub-file mapping to enforce robustness check of git-p4's client view support: //depot/branch1/base/dir/sub_file1 //client/branch1/sub_file1 Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-21t9801: git-p4: check ignore files with client specLibravatar Vitor Antunes1-3/+20
This test confirms that a file can be ignored during git p4 sync if if is excluded in P4 client specification. 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>
2012-08-20git p4: make branch detection work with --use-client-specLibravatar Pete Wyckoff1-1/+1
The bug report in http://stackoverflow.com/questions/11893688 observes that files are mapped into the wrong locations in git when both --use-client-spec and --branch-detection are enabled. Fix this by changing the relative path prefix to match discovered branches when using a client spec. The problem was likely introduced with ecb7cf9 (git-p4: rewrite view handling, 2012-01-02). Signed-off-by: Pete Wyckoff <pw@padd.com> Tested-by: Matthew Korich <matthew@korich.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-11git p4 test: add broken --use-client-spec --detect-branches testsLibravatar Pete Wyckoff1-0/+77
Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-29git-p4: Clean up branch test casesLibravatar Vitor Antunes1-3/+1
Correct submit description in one test and remove not required commands from another. 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>
2012-05-29git-p4: Verify detection of "empty" branch creationLibravatar Vitor Antunes1-0/+54
Current implementation of new branch parent detection works on the principle that the new branch is a complete integration, with no changes, of the original files. This test shows this deficiency in the particular case when the new branch is created from a subset of the original files. 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>
2012-05-29git-p4: Test changelists touching two branchesLibravatar Vitor Antunes1-0/+52
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>
2012-04-09git p4: use "git p4" directly in testsLibravatar Pete Wyckoff1-16/+16
Drop the $GITP4 variable that was used to specify the script in contrib/fast-import/. The command is called "git p4" now, not "git-p4". Note that configuration variables will remain in a section called "git-p4". Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-26t9801: do not overuse test_must_failLibravatar Junio C Hamano1-4/+4
test_must_fail is to make sure a program we can potentially break during the course of updating git itself exits with a non-zero status in a clean and controlled way. When we expect a non-zero exit status from the commands we use from the underlying platform in tests, e.g. making sure a string "error: " does not appear in the output by running "grep 'error: '", just use "! grep" for readability. It is not like we will try to update Git and suddenly 'grep' we use from the system starts segfaulting. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-26git-p4: Add test case for complex branch importLibravatar Vitor Antunes1-7/+87
Check if branches created from old changelists are correctly imported. Also included some updates to simple branch test so that both are coherent in respect to each other. 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>
2011-10-17git-p4 tests: refactor and cleanupLibravatar Pete Wyckoff1-0/+233
Introduce a library for functions that are common to multiple git-p4 test files. Be a bit more clever about starting and stopping p4d. Specify a unique port number for each test, so that tests can run in parallel. Start p4d not in daemon mode, and save the pid, to be able to kill it cleanly later. Never kill p4d at startup; always shutdown cleanly. Handle directory changes better. Always chdir inside a subshell, and remove any post-test directory changes. Clean up whitespace, and use test_cmp and test_must_fail more consistently. Separate the tests related to detecting p4 branches into their own file, and add a few more. Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>