Home | History | Annotate | Download | only in Scripts

Lines Matching refs:patch

33 # Differences from invoking "patch -p0 -R":
39 # Paths from Index: lines are used rather than the paths on the patch lines, which
43 # the patch before it is applied (svn-apply sets it when applying a patch).
44 # Handles binary files (requires patches made by svn-create-patch).
45 # Handles copied and moved files (requires patches made by svn-create-patch).
51 # Handle copied and moved directories (would require patches made by svn-create-patch).
52 # Use version numbers in the patch file and do a 3-way merge.
54 # Notice a patch that's being unapplied at the "wrong level" and make it work anyway.
55 # Do a dry run on the whole patch and don't do anything if part of the patch is
75 sub patch($);
103 my $patch;
113 if ($patch) {
115 push @copiedFiles, $patch;
117 patch($patch);
120 $patch = "";
133 $patch .= $_;
134 $patch .= $eol;
137 if ($patch) {
139 push @copiedFiles, $patch;
141 patch($patch);
146 for $patch (@copiedFiles) {
147 patch($patch);
166 sub patch($)
168 my ($patch) = @_;
169 return if !$patch;
171 unless ($patch =~ m|^Index: ([^\r\n]+)|) {
173 warn "Failed to find 'Index:' in:\n$separator\n$patch\n$separator\n";
183 $addition = 1 if ($patch =~ /\n--- .+\(revision 0\)\n/ || $patch =~ /\n@@ -0,0 .* @@/);
184 $deletion = 1 if $patch =~ /\n@@ .* \+0,0 @@/;
185 $isBinary = 1 if $patch =~ /\nCannot display: file marked as a binary type\./;
188 # Standard patch, patch tool can handle this.
191 unapplyPatch(unsetChangeLogDate($fullPath, fixChangeLogPatch($patch)), $fullPath, ["--fuzz=3"]);
194 unapplyPatch($patch, $fullPath);
207 unapplyPatch($patch, $fullPath);
214 # Keep the version from the patch in case it's different from svn.
231 unapplyPatch($patch, $fullPath, ["--force"]);
271 # $patch: a patch string.
274 # found in the patch's "Index:" line.
275 # $options: a reference to an array of options to pass to the patch command.
279 my ($patch, $pathRelativeToRoot, $options) = @_;
283 my $exitStatus = runPatchCommand($patch, $repositoryRootPath, $pathRelativeToRoot, $optionalArgs);
293 my $patch = shift;
300 $patch =~ s/(\n\+)\d{4}-[^-]{2}-[^-]{2}( )/$1$newDate$2/;
301 return $patch;