From: Simon Hausmann Date: Thu, 8 Feb 2007 22:00:19 +0000 (+0100) Subject: Added a little helper script to debug the output of the p4 python interface. X-Git-Tag: v1.5.3-rc0~65^2^2~217 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=20c7bc76b90084da6b99a1627427c000c06ef53a;p=git.git Added a little helper script to debug the output of the p4 python interface. Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/p4-debug.p4 b/contrib/fast-import/p4-debug.p4 new file mode 100755 index 000000000..8fb159fd6 --- /dev/null +++ b/contrib/fast-import/p4-debug.p4 @@ -0,0 +1,25 @@ +#!/usr/bin/python +# +# p4-debug.py +# +# Author: Simon Hausmann +# License: MIT +# +# executes a p4 command with -G and prints the resulting python dicts +# +import os, string, sys +import marshal, popen2 + +cmd = "" +for arg in sys.argv[1:]: + cmd += arg + " " + +pipe = os.popen("p4 -G %s" % cmd, "rb") +try: + while True: + entry = marshal.load(pipe) + print entry +except EOFError: + pass +pipe.close() +