From: Jarkko Hietaniemi Date: Tue, 1 Aug 2000 18:05:28 +0000 (+0000) Subject: Make p4desc to skip non-mainperl branches by default. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9058bc9b7176f7a8d171bb316d39680b3246ce5f;p=p5sagit%2Fp5-mst-13.2.git Make p4desc to skip non-mainperl branches by default. p4raw-id: //depot/perl@6480 --- diff --git a/Porting/p4desc b/Porting/p4desc index 0bf79da..cdbd957 100755 --- a/Porting/p4desc +++ b/Porting/p4desc @@ -6,7 +6,8 @@ # Gurusamy Sarathy # -use vars qw($thisfile $change $file $fnum $h $v $p4port @addfiles); +use vars qw($thisfile $change $file $fnum $h $v $p4port @addfiles + $branches $skip); BEGIN { $0 =~ s|^.*/||; @@ -18,6 +19,9 @@ BEGIN { elsif (/^-p(.*)$/) { $p4port = $1 || ' '; } + elsif (/^-b(.*)$/) { + $branches = $1; + } elsif (/^-v$/) { $v++; } @@ -30,20 +34,28 @@ BEGIN { } unless (@files) { @files = '-'; undef $^I; } @ARGV = @files; + $branches = '//depot/perl/' unless defined $branches; if ($h) { print STDERR < change-123.desc @@ -65,14 +77,26 @@ my $cur = m|^Affected files| ... m|^Differences|; # while we are within range if ($cur) { - if (m{^\.\.\. (//depot/.+?#\d+) (add|branch)$}) { - my $newfile = $1; - push @addfiles, $newfile; - warn "$newfile add, revision != 1!\n" unless $newfile =~ /#1$/; + if (m|^\.\.\. |) { + if (m|$branches|) { + if (m{^\.\.\. (//depot/.+?\#\d+) (add|branch)$}) { + my $newfile = $1; + push @addfiles, $newfile; + warn "$newfile add, revision != 1!\n" unless $newfile =~ /#1$/; + } + } else { + $_ = "# Skipped: $_"; + } } warn "file [$file] line [$cur] file# [$fnum]\n" if $v; } +if (m|^==== //depot/|) { + $skip = !m|$branches|; +} + +$_ = "# $_" if $skip; + if (/^Change (\d+) by/) { $_ = "\n\n" . $_ if $change; # start of a new change list $change = $1;