Lines Matching refs:patch
310 my $patch;
312 # Read in patch for incorrectly merged ChangeLog entry
316 $patch = <GIT>;
324 # The patch must have 0 or more lines of context, then 1 or more lines
326 if ($patch =~ /\n@@ -(\d+),(\d+) \+(\d+),(\d+) @@\n( .*\n)*((\+.*\n)+)( .*\n)+$/m) {
327 # Copy the header from the original patch.
328 my $newPatch = substr($patch, 0, index($patch, "@@ -${1},${2} +${3},${4} @@"));
330 # Generate a new set of line numbers and patch lengths. Our new
331 # patch will start with the lines for the fixed ChangeLog entry,
333 # make the patch apply cleanly.
337 # at the bottom of the list of added lines (due to the way the patch
357 # Apply the new patch
358 open(PATCH, "| patch -p1 $file > " . File::Spec->devnull()) or die $!;
359 print PATCH $newPatch;
360 close(PATCH) or die $!;
367 } elsif ($patch) {
394 my $patch;
397 $patch = <DIFF>;
403 $patch = <DIFF>;
410 open(PATCH, "| patch --fuzz=3 --binary $fileNewer > " . File::Spec->devnull()) or die $!;
411 print PATCH fixChangeLogPatch($patch);
412 close(PATCH);
416 # Refuse to merge the patch if it did not apply cleanly