summaryrefslogtreecommitdiff
path: root/contrib/fast-import/p4-debug.py
blob: 8fb159fd6a3e832b62dc24376722b738858ea539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()