Bug 33134 - Create a unit tested parsePatchHeader() subroutine for svn-apply and svn-unapply
Summary: Create a unit tested parsePatchHeader() subroutine for svn-apply and svn-unapply
Status: RESOLVED DUPLICATE of bug 33447
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Chris Jerdonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-04 00:29 PST by Chris Jerdonek
Modified: 2010-01-10 12:49 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jerdonek 2010-01-04 00:29:06 PST
Create a unit tested parsePatchHeader() subroutine for svn-apply and svn-unapply.  In addition to providing more test coverage, this will result in more code sharing between svn-apply and svn-unapply.

This affects the code in the main while(<>) loop of both scripts:

while (<>) {
    s/([\n\r]+)$//mg;
    my $eol = $1;
    if (!defined($indexPath) && m#^diff --git a/#) {
        $filter = \&gitdiff2svndiff;
    }
    $_ = &$filter($_) if $filter;
    if (/^Index: (.+)/) {
        ...
    }
    if ($indexPath) {
        # Fix paths on diff, ---, and +++ lines to match preceding Index: line.
        s/^--- \S+/--- $indexPath/;
        if (/^--- .+\(from (\S+):\d+\)$/) {
            $copiedFromPath = $1;
        }
        if (s/^\+\+\+ \S+/+++ $indexPath/) {
            $indexPath = "";
        }
Comment 1 Chris Jerdonek 2010-01-10 12:49:07 PST

*** This bug has been marked as a duplicate of bug 33447 ***