From: Gurusamy Sarathy Date: Sun, 5 May 2002 08:41:22 +0000 (+0000) Subject: p4genpatch diffs against depot files from //depot/perl when called X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e3fb1fa4fee118c59049f595d780cb8655c399e;p=p5sagit%2Fp5-mst-13.2.git p4genpatch diffs against depot files from //depot/perl when called with -b //depot/maint-5.6/perl p4raw-id: //depot/perl@16414 --- diff --git a/Porting/p4genpatch b/Porting/p4genpatch index f9a1f4d..3b0bae3 100644 --- a/Porting/p4genpatch +++ b/Porting/p4genpatch @@ -53,16 +53,18 @@ for my $a (@action) { $tempdir ||= tempdir( "tmp-XXXX", CLEANUP => 1, TMPDIR => 1 ); my($action,$file,$prefix) = @$a; my($path,$basename,$number) = $file =~ m|\Q$prefix\E/(.+/)?([^/]+)#(\d+)|; + my($prevfile) = $file =~ m|^(.+)#\d+\z|; die "Panic: Could not parse file[$file]" unless $number; $path = "" unless defined $path; my($d1,$d2,$prev); $prev = $number-1; + $prevfile .= "#$prev"; if ($prev==0 or $action =~ /^(add|branch)$/) { $d1 = "/dev/null"; } elsif ($action =~ /^(edit|integrate)$/) { $d1 = "$path$basename#$prev"; warn "==> $d1 <==\n" if $OPT{v}; - my $system = "p4 @P4opt print -o $tempdir/$d1 //depot/$path$basename#$prev"; + my $system = "p4 @P4opt print -o $tempdir/$d1 $prevfile"; my $status = `$system`; if ($?) { warn "$0: system[$system] failed, status[$?]\n";