diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-03-28 06:00:46 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-03-28 06:00:46 +0000 |
commit | 95470547e854df745a1dec3565d4ef1ed8634342 (patch) | |
tree | 53c3eafb7812cc2076539415ba7cc141ccc26a6f | |
parent | c4e7bd8d7008b59d7502296f4da5ed2d4592e5f9 (diff) | |
download | perl-95470547e854df745a1dec3565d4ef1ed8634342.tar.gz |
update p4 utility to ignore non-text files
p4raw-id: //depot/perl@3183
-rwxr-xr-x | Porting/p4desc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Porting/p4desc b/Porting/p4desc index 062a6f122b..7bac3eb1f2 100755 --- a/Porting/p4desc +++ b/Porting/p4desc @@ -1,4 +1,4 @@ -#!/l/local/bin/perl -wpi.bak +#!/usr/bin/perl -wpi.bak # # Munge "p4 describe ..." output to include new files. @@ -90,12 +90,23 @@ sub newfiles { my $addfile; my $ret = ""; for $addfile (@addfiles) { + my $type = `p4 -p $p4port files $addfile`; + if ($?) { + warn "$0: `p4 -p $p4port print $addfile` failed, status[$?]\n"; + next; + } + $type =~ m|^//.*\((.+)\)$| or next; + $type = $1; + unless ($type =~ /text/) { + $ret .= "\n==== $addfile ($type) ====\n\n"; + next; + } my @new = `p4 -p $p4port print $addfile`; if ($?) { die "$0: `p4 -p $p4port print $addfile` failed, status[$?]\n"; } my $desc = shift @new; # discard initial description - $ret .= "\n==== $addfile (text) ====\n\n"; + $ret .= "\n==== $addfile ($type) ====\n\n"; my $lines = "," . @new; $lines = "" if @new < 2; $ret .= "\@\@ -0,0 +1$lines \@\@\n"; |