1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-21 18:36:07 +02:00

git-p4: fix filetype detection on files opened exclusively

If a Perforce server is configured to automatically set +l
(exclusive lock) on add of certain file types, git p4 submit will
fail during getP4OpenedType, as the regex doesn't expect the
trailing '*exclusive*' from p4 opened:

  //depot/file.png#1 - add default change (binary+l) *exclusive*

Signed-off-by: Blair Holloway <blair_holloway@playstation.sony.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Blair Holloway 2015-04-04 09:46:03 +01:00 committed by Junio C Hamano
parent d077c2db8d
commit 34a0dbfc6b
2 changed files with 3 additions and 3 deletions

View File

@ -368,7 +368,7 @@ def getP4OpenedType(file):
# Returns the perforce file type for the given file.
result = p4_read_pipe(["opened", wildcard_encode(file)])
match = re.match(".*\((.+)\)\r?$", result)
match = re.match(".*\((.+)\)( \*exclusive\*)?\r?$", result)
if match:
return match.group(1)
else:

View File

@ -35,7 +35,7 @@ test_expect_success 'edit with lock not taken' '
)
'
test_expect_failure 'add with lock not taken' '
test_expect_success 'add with lock not taken' '
test_when_finished cleanup_git &&
git p4 clone --dest="$git" //depot &&
(
@ -107,7 +107,7 @@ test_expect_failure 'chmod with lock taken' '
)
'
test_expect_failure 'copy with lock taken' '
test_expect_success 'copy with lock taken' '
lock_in_another_client &&
test_when_finished cleanup_git &&
test_when_finished "cd \"$cli\" && p4 revert file2 && rm -f file2" &&