-def describe(change):
- describeOutput = p4Cmd("describe %s" % change)
-
- author = describeOutput["user"]
- epoch = describeOutput["time"]
-
- log = describeOutput["desc"]
-
- changed = []
- removed = []
-
- i = 0
- while describeOutput.has_key("depotFile%s" % i):
- path = describeOutput["depotFile%s" % i]
- rev = describeOutput["rev%s" % i]
- action = describeOutput["action%s" % i]
- path = path + "#" + rev
-
- if action == "delete":
- removed.append(path)
- else:
- changed.append(path)
-
- i = i + 1
-
- return author, log, epoch, changed, removed
-
-def p4Stat(path):
- output = os.popen("p4 fstat -Ol \"%s\"" % path).readlines()
- fileSize = 0
- mode = 644
- for line in output:
- if line.startswith("... headType x"):
- mode = 755
- elif line.startswith("... fileSize "):
- fileSize = long(line[12:])
- return mode, fileSize
-
-def stripRevision(path):
- hashPos = path.rindex("#")
- return path[:hashPos]