#!/usr/local/bin/python # describechanges.py # Wrtten by Josh Grigonis # Date: 2/2000 import os, re, string, sys, makemetricsfiles made = 0 if len (sys.argv) < 4: print "This command requires the depot path, the previous build label" print "and the current build label as parameters." print "For Example:" print "\tdescribechanges //depot/... JACKALOPE.16 JACKALOPE.17" sys.exit(1) change_pattern = re.compile ('^> Change [0-9]* .*', re.IGNORECASE) changelist = [] if not os.path.isfile (sys.argv[3] + '.diff'): makemetricsfiles.create (sys.argv[1], sys.argv[2], sys.argv[3]) made = 1 try: file = open (sys.argv[3] + '.diff', 'r') except: print "Error opening file " + sys.argv[3] + ".diff" sys.exit(1) for line in file.readlines(): x = change_pattern.match(line) if x != None: thestring = x.group() thelist = string.split(thestring) changelist.append(thelist[2]) for x in changelist: for line in os.popen ("p4 describe "+x).readlines(): print line, print "\n" print "==============================================================================\n" file.close() if made == 1: os.remove (sys.argv[2] + '.txt') os.remove (sys.argv[3] + '.txt') os.remove (sys.argv[3] + ".diff")