{"thread":{"id":"39002","subject":"[PATCH v2 1/3] git-p4: fix small bug in locked test scripts","startedAt":"2015-04-04T08:46:00Z","lastAt":"2015-04-04T08:46:03Z","messageCount":4,"participants":["Luke Diamand"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"258987","messageId":"1428137163-13219-1-git-send-email-luke@diamand.org","threadId":"39002","inReplyTo":null,"subject":"[PATCH v2 0/3] git-p4: updated locked file handling patch series","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-04T08:46:00Z","receivedAt":"2015-04-04T08:46:00Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Updated patch series for fixing git-p4 filetype detection when one or more\nfiles have been locked automatically by p4 (fix provided by Blair),\nincorporating comments from Eric:\n\n - squashes the actual fix and the test case change together\n - fixes typo\n\nLuke\n\nHolloway, Blair (1):\n  git-p4: fix filetype detection on files opened exclusively\n\nLuke Diamand (2):\n  git-p4: fix small bug in locked test scripts\n  git-p4: small fix for locked-file-move-test\n\n git-p4.py                |  2 +-\n t/t9816-git-p4-locked.sh | 10 +++++-----\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\n-- \n2.3.4.48.g223ab37\n"},{"id":"258986","messageId":"1428137163-13219-2-git-send-email-luke@diamand.org","threadId":"39002","inReplyTo":"1428137163-13219-1-git-send-email-luke@diamand.org","subject":"[PATCH v2 1/3] git-p4: fix small bug in locked test scripts","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-04T08:46:01Z","receivedAt":"2015-04-04T08:46:01Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Test script t9816-git-p4-locked.sh test #4 tests for\nadding a file that is locked by Perforce automatically.\nThis is currently not supported by git-p4 and so is\nexpected to fail.\n\nHowever, a small typo meant it always failed, even with\na fixed git-p4. Fix the typo to resolve this.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n t/t9816-git-p4-locked.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\nindex e71e543..ce0eb22 100755\n--- a/t/t9816-git-p4-locked.sh\n+++ b/t/t9816-git-p4-locked.sh\n@@ -41,7 +41,7 @@ test_expect_failure 'add with lock not taken' '\n \t(\n \t\tcd \"$git\" &&\n \t\techo line1 >>add-lock-not-taken &&\n-\t\tgit add file2 &&\n+\t\tgit add add-lock-not-taken &&\n \t\tgit commit -m \"add add-lock-not-taken\" &&\n \t\tgit config git-p4.skipSubmitEdit true &&\n \t\tgit p4 submit --verbose\n-- \n2.3.4.48.g223ab37\n"},{"id":"258989","messageId":"1428137163-13219-3-git-send-email-luke@diamand.org","threadId":"39002","inReplyTo":"1428137163-13219-1-git-send-email-luke@diamand.org","subject":"[PATCH v2 2/3] git-p4: small fix for locked-file-move-test","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-04T08:46:02Z","receivedAt":"2015-04-04T08:46:02Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"The test for handling of failure when trying to move a file\nthat is locked by another client was not quite correct - it\nfailed early on because the target file in the move already\nexisted.\n\nThe test now fails because git-p4 does not properly detect\nthat p4 has rejected the move, and instead just crashes. At\npresent, git-p4 has no support for detecting that a file\nhas been locked and reporting it to the user, so this is\nthe expected outcome.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n t/t9816-git-p4-locked.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\nindex ce0eb22..464f10b 100755\n--- a/t/t9816-git-p4-locked.sh\n+++ b/t/t9816-git-p4-locked.sh\n@@ -130,8 +130,8 @@ test_expect_failure 'move with lock taken' '\n \tgit p4 clone --dest=\"$git\" //depot &&\n \t(\n \t\tcd \"$git\" &&\n-\t\tgit mv file1 file2 &&\n-\t\tgit commit -m \"mv file1 to file2\" &&\n+\t\tgit mv file1 file3 &&\n+\t\tgit commit -m \"mv file1 to file3\" &&\n \t\tgit config git-p4.skipSubmitEdit true &&\n \t\tgit config git-p4.detectRenames true &&\n \t\tgit p4 submit --verbose\n-- \n2.3.4.48.g223ab37\n"},{"id":"258988","messageId":"1428137163-13219-4-git-send-email-luke@diamand.org","threadId":"39002","inReplyTo":"1428137163-13219-1-git-send-email-luke@diamand.org","subject":"[PATCH v2 3/3] git-p4: fix filetype detection on files opened exclusively","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-04T08:46:03Z","receivedAt":"2015-04-04T08:46:03Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"From: \"Holloway, Blair\" <Blair_Holloway@playstation.sony.com>\n\nIf a Perforce server is configured to automatically set +l (exclusive lock) on\nadd of certain file types, git p4 submit will fail during getP4OpenedType, as\nthe regex doesn't expect the trailing '*exclusive*' from p4 opened:\n\n//depot/file.png#1 - add default change (binary+l) *exclusive*\n\nSigned-off-by: Blair Holloway <blair_holloway@playstation.sony.com>\nAcked-by: Luke Diamand <luke@diamand.org>\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n git-p4.py                | 2 +-\n t/t9816-git-p4-locked.sh | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex ff132b2..d43482a 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -368,7 +368,7 @@ def getP4OpenedType(file):\n     # Returns the perforce file type for the given file.\n \n     result = p4_read_pipe([\"opened\", wildcard_encode(file)])\n-    match = re.match(\".*\\((.+)\\)\\r?$\", result)\n+    match = re.match(\".*\\((.+)\\)( \\*exclusive\\*)?\\r?$\", result)\n     if match:\n         return match.group(1)\n     else:\ndiff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh\nindex 464f10b..d048bd3 100755\n--- a/t/t9816-git-p4-locked.sh\n+++ b/t/t9816-git-p4-locked.sh\n@@ -35,7 +35,7 @@ test_expect_success 'edit with lock not taken' '\n \t)\n '\n \n-test_expect_failure 'add with lock not taken' '\n+test_expect_success 'add with lock not taken' '\n \ttest_when_finished cleanup_git &&\n \tgit p4 clone --dest=\"$git\" //depot &&\n \t(\n@@ -107,7 +107,7 @@ test_expect_failure 'chmod with lock taken' '\n \t)\n '\n \n-test_expect_failure 'copy with lock taken' '\n+test_expect_success 'copy with lock taken' '\n \tlock_in_another_client &&\n \ttest_when_finished cleanup_git &&\n \ttest_when_finished \"cd \\\"$cli\\\" && p4 revert file2 && rm -f file2\" &&\n-- \n2.3.4.48.g223ab37\n"}]}