contrib / fast-import / p4-debug.p4on commit Make it possible to specify the p4 changes to import through a text file (for debugging) and made various improvements to the branch/merge heuristic detection. (0563a45)
   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#
  10import os, string, sys
  11import marshal, popen2
  12
  13cmd = ""
  14for arg in sys.argv[1:]:
  15    cmd += arg + " "
  16
  17pipe = os.popen("p4 -G %s" % cmd, "rb")
  18try:
  19    while True:
  20        entry = marshal.load(pipe)
  21        print entry
  22except EOFError:
  23    pass
  24pipe.close()
  25