Changeset 57455 in webkit


Ignore:
Timestamp:
Apr 11, 2010 1:19:01 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-11 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by Eric Seidel.

svn-apply errors out when removing directories in git
https://bugs.webkit.org/show_bug.cgi?id=34871

  • Scripts/svn-apply: (isDirectoryEmptyForRemoval): early break if the directory doesn't exist (scmRemove): have git ignore unmatched files
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r57453 r57455  
     12010-04-11  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        svn-apply errors out when removing directories in git
     6        https://bugs.webkit.org/show_bug.cgi?id=34871
     7
     8        * Scripts/svn-apply:
     9        (isDirectoryEmptyForRemoval): early break if the directory doesn't exist
     10        (scmRemove): have git ignore unmatched files
     11
    1122010-04-11  Daniel Bates  <dbates@rim.com>
    213
  • trunk/WebKitTools/Scripts/svn-apply

    r57453 r57455  
    311311{
    312312    my ($dir) = @_;
     313    return 1 unless -d $dir;
    313314    my $directoryIsEmpty = 1;
    314315    opendir DIR, $dir or die "Could not open '$dir' to list files: $?";
     
    482483        print $svnOutput if $svnOutput;
    483484    } elsif (isGit()) {
    484         system("git", "rm", "--force", $path) == 0 or die  "Failed to git rm --force $path.";
    485     }
    486 }
     485        # Git removes a directory if it becomes empty when the last file it contains is
     486        # removed by `git rm`. In svn-apply this can happen when a directory is being
     487        # removed in a patch, and all of the files inside of the directory are removed
     488        # before attemping to remove the directory itself. In this case, Git will have
     489        # already deleted the directory and `git rm` would exit with an error claiming
     490        # there was no file. The --ignore-unmatch switch gracefully handles this case.
     491        system("git", "rm", "--force", "--ignore-unmatch", $path) == 0 or die "Failed to git rm --force --ignore-unmatch $path.";
     492    }
     493}
Note: See TracChangeset for help on using the changeset viewer.