allinteg.pl #1

  • //
  • guest/
  • paul_goffin/
  • Scripts/
  • allinteg.pl
  • View
  • Commits
  • Open Download .zip Download (512 B)
#!/usr/bin/perl
#
# allinteg.pl
#
# Mine the integration history of
# a file and then obtain the "integrated"
# list for all files found in that history.
#
# The idea is to find all files related
# to a particular file in order to locate
# others which may need a common bug fix (etc.)
#
#

require 5.0;
use strict;

my @history = `p4 filelog -i $ARGV[0]`;

# look for lines beginning with "//"
# as they are roots of branches.

foreach(@history) {
	if (index ($_, "//") == 0) {
		print `p4 integrated $_`;
	}
}
# Change User Description Committed
#1 312 paul_goffin Script to answer the question:
'What other files is this one related to'.

The idea was to be able to mine the depot for
files that have some branching relationship with
a particular file and so locate candidates
which might need a common fix applied.