diff options
author | Simon Hausmann <simon@lst.de> | 2007-02-08 23:00:19 +0100 |
---|---|---|
committer | Simon Hausmann <simon@lst.de> | 2007-02-08 23:00:19 +0100 |
commit | 20c7bc76b90084da6b99a1627427c000c06ef53a (patch) | |
tree | 8d80ec02bc6edd7e74b2f7b655d0d594f5651078 /contrib/fast-import/p4-debug.p4 | |
parent | Made the name of the git branch used for the perforce import configurable thr... (diff) | |
download | tgif-20c7bc76b90084da6b99a1627427c000c06ef53a.tar.xz |
Added a little helper script to debug the output of the p4 python interface.
Signed-off-by: Simon Hausmann <simon@lst.de>
Diffstat (limited to 'contrib/fast-import/p4-debug.p4')
-rwxr-xr-x | contrib/fast-import/p4-debug.p4 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/fast-import/p4-debug.p4 b/contrib/fast-import/p4-debug.p4 new file mode 100755 index 0000000000..8fb159fd6a --- /dev/null +++ b/contrib/fast-import/p4-debug.p4 @@ -0,0 +1,25 @@ +#!/usr/bin/python +# +# p4-debug.py +# +# Author: Simon Hausmann <hausmann@kde.org> +# License: MIT <http://www.opensource.org/licenses/mit-license.php> +# +# 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() + |