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>
This commit is contained in:
parent
29b802aae6
commit
75bc9573b0
@ -249,9 +249,16 @@ def p4Where(depotPath):
|
|||||||
outputList = p4CmdList("where %s" % depotPath)
|
outputList = p4CmdList("where %s" % depotPath)
|
||||||
output = None
|
output = None
|
||||||
for entry in outputList:
|
for entry in outputList:
|
||||||
|
if "depotFile" in entry:
|
||||||
if entry["depotFile"] == depotPath:
|
if entry["depotFile"] == depotPath:
|
||||||
output = entry
|
output = entry
|
||||||
break
|
break
|
||||||
|
elif "data" in entry:
|
||||||
|
data = entry.get("data")
|
||||||
|
space = data.find(" ")
|
||||||
|
if data[:space] == depotPath:
|
||||||
|
output = entry
|
||||||
|
break
|
||||||
if output == None:
|
if output == None:
|
||||||
return ""
|
return ""
|
||||||
if output["code"] == "error":
|
if output["code"] == "error":
|
||||||
|
Loading…
Reference in New Issue
Block a user