Added a little helper script to debug the output of the p4 python interface.
Signed-off-by: Simon Hausmann <simon@lst.de>
Simon Hausmann committed
Feb 8, 2007 at 23:00 UTC
20c7bc76b90084da6b99a1627427c000c06ef53a
1 file changed
+25
contrib/fast-import/p4-debug.p4
new
+25
@@ -0,0 +1,25 @@
1
+#!/usr/bin/python
2
+#
3
+# p4-debug.py
4
+#
5
+# Author: Simon Hausmann <hausmann@kde.org>
6
+# License: MIT <http://www.opensource.org/licenses/mit-license.php>
7
+#
8
+# executes a p4 command with -G and prints the resulting python dicts
9
+#
10
+import os, string, sys
11
+import marshal, popen2
12
+
13
+cmd = ""
14
+for arg in sys.argv[1:]:
15
+ cmd += arg + " "
16
+
17
+pipe = os.popen("p4 -G %s" % cmd, "rb")
18
+try:
19
+ while True:
20
+ entry = marshal.load(pipe)
21
+ print entry
22
+except EOFError:
23
+ pass
24
+pipe.close()
25
+