summaryrefslogtreecommitdiff
path: root/t/t9809-git-p4-client-view.sh
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2012-04-30 00:57:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-04-30 23:00:08 (GMT)
commit9d7d446ae94d03ff3b7b32e7341198d9b2c5b222 (patch)
tree66615bb835b2d131acd1a46b1b012f3584e69053 /t/t9809-git-p4-client-view.sh
parentb6ad6dcc3b0629d525abc9fe0882e1b0eb969e17 (diff)
downloadgit-9d7d446ae94d03ff3b7b32e7341198d9b2c5b222.zip
git-9d7d446ae94d03ff3b7b32e7341198d9b2c5b222.tar.gz
git-9d7d446ae94d03ff3b7b32e7341198d9b2c5b222.tar.bz2
git p4: submit files with wildcards
There are four wildcard characters in p4. Files with these characters can be added to p4 repos using the "-f" option. They are stored in %xx notation, and when checked out, p4 converts them back to normal. When adding files with wildcards in git, the submit path must be careful to use the encoded names in some places, and it must use "-f" to add them. All other p4 commands that operate on the client directory expect encoded filenames as arguments. Support for wildcards in the clone/sync path was added in 084f630 (git-p4: decode p4 wildcard characters, 2011-02-19), but that change did not handle the submit path. There was a problem with wildcards in the sync path too. Commit 084f630 (git-p4: decode p4 wildcard characters, 2011-02-19) handled files with p4 wildcards that were added or modified in p4. Do this for deleted files, and also in branch detection checks, too. Reported-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9809-git-p4-client-view.sh')
-rwxr-xr-xt/t9809-git-p4-client-view.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh
index 43ed1fe..7d993ef 100755
--- a/t/t9809-git-p4-client-view.sh
+++ b/t/t9809-git-p4-client-view.sh
@@ -374,6 +374,39 @@ test_expect_success 'subdir clone, submit rename' '
)
'
+# see t9800 for the non-client-spec case, and the rest of the wildcard tests
+test_expect_success 'wildcard files submit back to p4, client-spec case' '
+ client_view "//depot/... //client/..." &&
+ test_when_finished cleanup_git &&
+ git p4 clone --use-client-spec --dest="$git" //depot/dir1 &&
+ (
+ cd "$git" &&
+ echo git-wild-hash >dir1/git-wild#hash &&
+ echo git-wild-star >dir1/git-wild\*star &&
+ echo git-wild-at >dir1/git-wild@at &&
+ echo git-wild-percent >dir1/git-wild%percent &&
+ git add dir1/git-wild* &&
+ git commit -m "add some wildcard filenames" &&
+ git config git-p4.skipSubmitEditCheck true &&
+ git p4 submit
+ ) &&
+ (
+ cd "$cli" &&
+ test_path_is_file dir1/git-wild#hash &&
+ test_path_is_file dir1/git-wild\*star &&
+ test_path_is_file dir1/git-wild@at &&
+ test_path_is_file dir1/git-wild%percent
+ ) &&
+ (
+ # delete these carefully, cannot just do "p4 delete"
+ # on files with wildcards; but git-p4 knows how
+ cd "$git" &&
+ git rm dir1/git-wild* &&
+ git commit -m "clean up the wildcards" &&
+ git p4 submit
+ )
+'
+
test_expect_success 'reinit depot' '
(
cd "$cli" &&