Bug 29622

Summary: svn-apply can exit(0) even on patch failure
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: Tools / TestsAssignee: Eric Seidel (no email) <eric>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mark
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on: 30826    
Bug Blocks:    
Attachments:
Description Flags
log from another silent failure
none
Hopefully catch all cases
none
Hopefully catch all cases none

Description Eric Seidel (no email) 2009-09-21 16:32:13 PDT
svn-apply can exit(0) even on patch failure

This is bad for the commit-queue/bugzilla-tool as it depends on svn-apply exiting non-zero on patch failure.  It's possible that bugzilla-tool could land an incomplete patch as-is.

Some examples from the code:

sub scmCopy($$)
{
    my ($source, $destination) = @_;
    if ($isSVN) {
        system "svn", "copy", $source, $destination;
    } elsif ($isGit) {
        system "cp", $source, $destination;
        system "git", "add", $destination;
    }
}

sub scmAdd($)
{
    my ($path) = @_;
    if ($isSVN) {
        system "svn", "add", $path;
    } elsif ($isGit) {
        system "git", "add", $path;
    }
}

sub scmRemove($)
{
    my ($path) = @_;
    if ($isSVN) {
        # SVN is very verbose when removing directories.  Squelch all output except the last line.
        my $svnOutput;
        open SVN, "svn rm --force '$path' |" or die "svn rm --force '$path' failed!";
        # Only print the last line.  Subversion outputs all changed statuses below $dir
        while (<SVN>) {
            $svnOutput = $_;
        }
        close SVN;
        print $svnOutput if $svnOutput;
    } elsif ($isGit) {
        system "git", "rm", "--force", $path;
    }
}
Comment 1 Eric Seidel (no email) 2009-09-24 15:03:00 PDT
Created attachment 40081 [details]
log from another silent failure
Comment 2 Mark Mentovai 2009-09-24 15:08:33 PDT
git diffs don't have Index: lines?
Comment 3 Eric Seidel (no email) 2009-09-24 15:09:14 PDT
I think the log message from svn-apply is misleading.
Comment 4 Eric Seidel (no email) 2009-09-24 15:11:00 PDT
svn-apply uses this magic function to convert git diffs to svn diffs before processing:
http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/svn-apply#L316

Also, I probably should have split out these two bugs.  The fact that that patch failed to apply is likely a separate bug from the fact that svn-apply can error out silently (thus causing badness!)
Comment 5 Eric Seidel (no email) 2009-10-23 17:15:48 PDT
Created attachment 41766 [details]
Hopefully catch all cases
Comment 6 Eric Seidel (no email) 2009-10-23 17:19:04 PDT
Created attachment 41767 [details]
Hopefully catch all cases
Comment 7 Adam Barth 2009-10-27 00:38:03 PDT
Comment on attachment 41767 [details]
Hopefully catch all cases

die die die!
Comment 8 WebKit Commit Bot 2009-10-27 03:09:28 PDT
Comment on attachment 41767 [details]
Hopefully catch all cases

Clearing flags on attachment: 41767

Committed r50137: <http://trac.webkit.org/changeset/50137>
Comment 9 WebKit Commit Bot 2009-10-27 03:09:32 PDT
All reviewed patches have been landed.  Closing bug.