#!/usr/bin/env perl use warnings; use strict; use Cwd; sub main() { stat("ls l-tr"); my %files; chdir ("/view/conflictcheck.view1/vobs/app_bos") or die "cannot change: $!\n"; print(cwd); while (<>) { my ($branch, $count); chomp; $branch = $_; next if !$branch; print "Scanning $branch\n"; open(FILES, "cleartool find . -nxn -ele \"version(/main/$branch/LATEST)\" -print |"); while () { chomp; push @{$files{$_}}, $branch; $count++; } close(FILES); if (!$count) { print "WARNING: $branch does not contain any files.\n" } } print "Calculating conflicts\n"; foreach my $file (keys %files) { my $len = @{$files{$file}}; next unless ($len > 1) && (-f $file); print "$file\n"; for (my $i = 0; $i < $len; $i++) { print " $files{$file}[$i]\n"; } } }