#!/usr/local/bin/python
import sys, os, re, string, makemetricsfiles
made = 0
prev_build_label = sys.argv[1]
build_label = sys.argv[2]
prev_build_label_file = sys.argv[1] + '.label'
build_label_file = sys.argv[2] + '.label'
if not os.path.isfile (build_label_file):
made = 1
makemetricsfiles.createlabel ('//depot/...', prev_build_label, build_label)
for line in os.popen( "diff " + prev_build_label_file + " " + build_label_file ).readlines():
if re.match( r"^\>", line ):
line = re.sub( r"#.*", "", line )
line = re.sub( r"\> ", "", line )
line = string.rstrip( line )
for diffline in os.popen( "p4 diff2 " + '"' + line + "@" + prev_build_label + '" "' + line + "@" + build_label + '"', 'r' ).readlines():
diffline = string.rstrip( diffline )
print diffline
print "\n\n"
# clean up generated files.
if made == 1:
os.remove( prev_build_label_file )
os.remove( build_label_file )
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #1 | 514 | Russell C. Jackson (Rusty) |
Source code metrics scripts. See metrics.py for usage. |