p4 -G
輸出其數據在marshal
ed表格不醃。
但是你是對的 - p4 -G diff -duw3
也不會聯合國marshal
,所以我想這裏有一個問題。
p4 -G opened
unmarshals罰款。但是任何一種diff
都會失敗。
這裏有一個相關的知識庫文章:http://kb.perforce.com/ToolsScripts/PerforceUtilities/UsingP4G
#!/usr/bin/env python
import marshal
import subprocess
# proc = subprocess.Popen(["p4","-G","diff","-duw3","configure.ac","Makefile.am"],stdout=subprocess.PIPE)
proc = subprocess.Popen(["p4","-G","diff"],stdout=subprocess.PIPE)
# proc = subprocess.Popen(["p4","-G","opened"],stdout=subprocess.PIPE)
pipe = proc.stdout
output = []
try:
while 1:
record = marshal.load(pipe)
output.append(record)
except EOFError:
pass
pipe.close()
proc.wait()
# print list of dictionary records
c = 0
for dict in output:
c = c + 1
print "\n--%d--" % c
for key in dict.keys():
print "%s: %s" % (key, dict[key])
正如道格拉斯說,這似乎是與P4的錯誤。您應該聯繫Perforce支持部門(並在此發佈回覆)。 – jhwist 2009-11-11 10:09:13
如果我收到回覆,我會做 - 我使用免費的2用戶許可證,所以我可能聽不到回覆。 – 2009-11-11 11:39:03