Merge git://repo.or.cz/git-gui
[gitweb.git] / contrib / fast-import / git-p4
index b44fbfc9b3988ba848aafe109682006254e46b21..a85a7b2a583ee9270fc2d765ec8c8c6e9d6b5e32 100755 (executable)
@@ -245,7 +245,22 @@ def p4Cmd(cmd):
 def p4Where(depotPath):
     if not depotPath.endswith("/"):
         depotPath += "/"
-    output = p4Cmd("where %s..." % depotPath)
+    depotPath = depotPath + "..."
+    outputList = p4CmdList("where %s" % depotPath)
+    output = None
+    for entry in outputList:
+        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":
         return ""
     clientPath = ""