Bug 150650 - svn-apply should handle unified diffs
Summary: svn-apply should handle unified diffs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dana Burkart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-28 17:46 PDT by Dana Burkart
Modified: 2015-11-02 10:48 PST (History)
5 users (show)

See Also:


Attachments
Patch (13.14 KB, patch)
2015-10-30 12:30 PDT, Dana Burkart
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dana Burkart 2015-10-28 17:46:44 PDT
When trying to apply a unified-style diff with svn-apply, I get this mysterious error:

Parsed 0 diffs from patch file(s).
No diff found. at /path/to/svn-apply line 126.

I suspect that this might be failing due to a slightly different diff heading style than
what svn-apply expects. In particular, diff chunks generated by `diff -u` generate headings
which immediately start with:

---- a/b/c/d
++++ a/b/c/d

Instead of something like:

diff --git a/b/c/d
index 1234..56787 100644
---- a/b/c/d
++++ a/b/c/d
Comment 1 Dana Burkart 2015-10-30 12:30:18 PDT
Created attachment 264408 [details]
Patch

Adds smarts to VCSUtils.pm to be able to apply standard unified patches produced by `diff u`.
Comment 2 Dana Burkart 2015-11-02 10:48:04 PST
Committed r191900.