summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 967f72e)
raw | patch | inline | side by side (parent: 967f72e)
author | Simon Hausmann <simon@lst.de> | |
Sat, 24 Mar 2007 08:15:11 +0000 (09:15 +0100) | ||
committer | Simon Hausmann <simon@lst.de> | |
Sat, 24 Mar 2007 08:15:11 +0000 (09:15 +0100) |
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4 | patch | blob | history |
index 61978c3da6ac184821c1433bfe1d5fd515df3617..95037862072e98e82ca1a8219c02ca45db983b04 100755 (executable)
result.update(entry)
return result;
+def p4Where(depotPath):
+ if not depotPath.endswith("/"):
+ depotPath += "/"
+ output = p4Cmd("where %s..." % depotPath)
+ clientPath = ""
+ if "path" in output:
+ clientPath = output.get("path")
+ elif "data" in output:
+ data = output.get("data")
+ lastSpace = data.rfind(" ")
+ clientPath = data[lastSpace + 1:]
+
+ if clientPath.endswith("..."):
+ clientPath = clientPath[:-3]
+ return clientPath
+
def die(msg):
sys.stderr.write(msg + "\n")
sys.exit(1)
print "Internal error: cannot locate perforce depot path from existing branches"
sys.exit(128)
- if not depotPath.endswith("/"):
- depotPath += "/"
- clientPath = p4Cmd("where %s..." % depotPath).get("path")
- if clientPath.endswith("..."):
- clientPath = clientPath[:-3]
+ clientPath = p4Where(depotPath)
if len(clientPath) == 0:
print "Error: Cannot locate perforce checkout of %s in client view" % depotPath