summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f6148d9)
raw | patch | inline | side by side (parent: f6148d9)
author | Simon Hausmann <hausmann@kde.org> | |
Wed, 31 Jan 2007 21:19:18 +0000 (22:19 +0100) | ||
committer | Simon Hausmann <hausmann@kde.org> | |
Wed, 31 Jan 2007 21:19:18 +0000 (22:19 +0100) |
Signed-off-by: Simon Hausmann <hausmann@kde.org>
contrib/fast-import/p4-fast-export.py | patch | blob | history |
index 3ccef526eba4614e67ddaa72b0d551f39aec0cc0..d3e65f0f390538a1489f044d851a72e866e352c7 100644 (file)
if not prefix.endswith("/"):
prefix += "/"
-def p4Cmd(cmd):
+def p4CmdList(cmd):
pipe = os.popen("p4 -G %s" % cmd, "rb")
- result = {}
+ result = []
try:
while True:
entry = marshal.load(pipe)
- result.update(entry)
+ result.append(entry)
except EOFError:
pass
pipe.close()
return result
+def p4Cmd(cmd):
+ list = p4CmdList(cmd)
+ result = {}
+ for entry in list:
+ result.update(entry)
+ return result;
+
def describe(change):
describeOutput = p4Cmd("describe %s" % change)
def getUserMap():
users = {}
- output = os.popen("p4 users")
- for line in output:
- firstSpace = line.index(" ")
- secondSpace = line.index(" ", firstSpace + 1)
- key = line[:firstSpace]
- email = line[firstSpace + 1:secondSpace]
- openParenPos = line.index("(", secondSpace)
- closedParenPos = line.index(")", openParenPos)
- name = line[openParenPos + 1:closedParenPos]
-
- users[key] = name + " " + email
+ for output in p4CmdList("users"):
+ if not output.has_key("User"):
+ continue
+ users[output["User"]] = output["FullName"] + " <" + output["Email"] + ">"
return users
users = getUserMap()