aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTor Arvid Lund <torarvid@gmail.com>2008-12-09 16:41:50 +0100
committerJunio C Hamano <gitster@pobox.com>2008-12-09 21:39:16 -0800
commit75bc9573b0e332c34bc1c3d97306077fda573083 (patch)
treeca973e1ce04def7f07a0e3da8c1f97d7d84cb60c /contrib
parent29b802aae6213d02879d21aabac1a8d2e035b583 (diff)
downloadgit-75bc9573b0e332c34bc1c3d97306077fda573083.tar.gz
git-75bc9573b0e332c34bc1c3d97306077fda573083.tar.xz
git-p4: Fix regression in p4Where method.
Unfortunately, I introduced a bug in commit 7f705dc36 (git-p4: Fix bug in p4Where method). This happens because sometimes the result from "p4 where <somepath>" doesn't contain a "depotFile" key, but instead a "data" key that needs further parsing. This commit should ensure that both of these cases are checked. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p413
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index ee504e90e..a85a7b2a5 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -249,9 +249,16 @@ def p4Where(depotPath):
outputList = p4CmdList("where %s" % depotPath)
output = None
for entry in outputList:
- if entry["depotFile"] == depotPath:
- output = entry
- break
+ if "depotFile" in entry:
+ if entry["depotFile"] == depotPath:
+ output = entry
+ break
+ elif "data" in entry:
+ data = entry.get("data")
+ space = data.find(" ")
+ if data[:space] == depotPath:
+ output = entry
+ break
if output == None:
return ""
if output["code"] == "error":