X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2Fp4genpatch;h=543baa9815107eda878f08e669fb32cab077e2d9;hb=357244ac7b8824046a2f6fdab432230dbbd8cadd;hp=ccedff1087e1aa60d612953ecfb51a826ed5a88f;hpb=9b174a274a0c344c57b61e8f1e323c3e74fd6d6c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/p4genpatch b/Porting/p4genpatch index ccedff1..543baa9 100644 --- a/Porting/p4genpatch +++ b/Porting/p4genpatch @@ -23,7 +23,7 @@ $0 =~ s|^.*[\\/]||; my $VERSION = '0.05'; my $TOPDIR = cwd(); my @P4opt; -our %OPT = ( "d" => "u", b => "//depot/perl", "D" => "diff" ); +our %OPT = ( "d" => "u", b => "//depot/perl/", "D" => "diff" ); Getopt::Long::Configure("no_ignore_case"); GetOptions(\%OPT, "b=s", "p=s", "d=s", "D=s", "h", "v", "V") or die Usage; print Usage and exit if $OPT{h}; @@ -42,6 +42,7 @@ while (<$p4>) { print; next unless m|($OPT{b})|; my($prefix) = $1; + $prefix =~ s|/$||; $prefix =~ s|/[^/]+$||; # up to the last "/" in the match is to be stripped if (my($file,$action) = m|^\.\.\. (//depot.*)\s(\w+)$|) { next if $action eq "delete"; @@ -160,9 +161,10 @@ sub Usage () { -p host:port p4 port (e.g. myhost:1666) -d diffopt option to pass to diff(1) -D diff diff(1) to use - -b branch(es) which branches to include (regex); everything up - to the last slash of matched portion of path is - stripped on local copy (default: //depot/perl) + -b branch(es) which branches to include (regex); the last + directory within the matched part will be + preserved on the local copy, so that patch -p1 + will work (default: "//depot/perl/") -v verbose -h print this help and exit -V print version number and exit