Bug 29622 - svn-apply can exit(0) even on patch failure
Summary: svn-apply can exit(0) even on patch failure
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on: 30826
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-21 16:32 PDT by Eric Seidel (no email)
Modified: 2009-10-27 10:26 PDT (History)
2 users (show)

See Also:


Attachments
log from another silent failure (1.70 KB, text/plain)
2009-09-24 15:03 PDT, Eric Seidel (no email)
no flags Details
Hopefully catch all cases (1.76 KB, patch)
2009-10-23 17:15 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Hopefully catch all cases (2.03 KB, patch)
2009-10-23 17:19 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.