git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-p4: fix filetype detection on files opened exclusively
@ 2015-03-31 21:54 Holloway, Blair
  2015-04-02 19:54 ` Luke Diamand
  0 siblings, 1 reply; 3+ messages in thread
From: Holloway, Blair @ 2015-03-31 21:54 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: luke@diamand.org, gitster@pobox.com

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>
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-p4.py b/git-p4.py
index ff132b2..d43482a 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -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:
-- 
1.8.3.msysgit.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-02 21:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-31 21:54 [PATCH] git-p4: fix filetype detection on files opened exclusively Holloway, Blair
2015-04-02 19:54 ` Luke Diamand
2015-04-02 21:17   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).