Changeset 46671 in webkit


Ignore:
Timestamp:
Aug 1, 2009 7:29:20 AM (15 years ago)
Author:
ddkilzer@apple.com
Message:

<http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths

Reviewed by Eric Seidel.

  • Scripts/resolve-ChangeLogs: Used chdirReturningRelativePath() and determineVCSRoot() to change directories to the root of the project before running the command and to provide a path for removeChangeLogArguments() to make sure any ChangeLog arguments on the command line are still found. (canonicalRelativePath): Added. Returns a canonical path (e.g., stripping 'dir/../' from the path) relative to the current directory. (removeChangeLogArguments): Added argument which contains a relative path that must be prepended to any ChangeLog arguments. Used canonicalRelativePath() and File::Spec->catfile() to construct a normalized, relative path to each file.
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r46670 r46671  
     12009-08-01  David Kilzer  <ddkilzer@apple.com>
     2
     3        <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
     4
     5        Reviewed by Eric Seidel.
     6
     7        * Scripts/resolve-ChangeLogs: Used chdirReturningRelativePath()
     8        and determineVCSRoot() to change directories to the root of the
     9        project before running the command and to provide a path for
     10        removeChangeLogArguments() to make sure any ChangeLog arguments
     11        on the command line are still found.
     12        (canonicalRelativePath): Added.  Returns a canonical path (e.g.,
     13        stripping 'dir/../' from the path) relative to the current
     14        directory.
     15        (removeChangeLogArguments): Added argument which contains a
     16        relative path that must be prepended to any ChangeLog arguments.
     17        Used canonicalRelativePath() and File::Spec->catfile() to
     18        construct a normalized, relative path to each file.
     19
    1202009-08-01  David Kilzer  <ddkilzer@apple.com>
    221
  • trunk/WebKitTools/Scripts/resolve-ChangeLogs

    r46095 r46671  
    4141use VCSUtils;
    4242
     43sub canonicalRelativePath($);
    4344sub conflictFiles($);
    4445sub findChangeLog($);
     
    5051sub mergeChanges($$$);
    5152sub parseFixMerged($$;$);
    52 sub removeChangeLogArguments();
     53sub removeChangeLogArguments($);
    5354sub resolveChangeLog($);
    5455sub resolveConflict($);
     
    7778);
    7879
    79 my @changeLogFiles = removeChangeLogArguments();
     80my $relativePath = chdirReturningRelativePath(determineVCSRoot());
     81
     82my @changeLogFiles = removeChangeLogArguments($relativePath);
    8083
    8184if (!defined $fixMerged && scalar(@changeLogFiles) == 0) {
     
    142145
    143146exit 0;
     147
     148sub canonicalRelativePath($)
     149{
     150    my ($originalPath) = @_;
     151    my $absolutePath = Cwd::abs_path($originalPath);
     152    return File::Spec->abs2rel($absolutePath);
     153}
    144154
    145155sub conflictFiles($)
     
    483493}
    484494
    485 sub removeChangeLogArguments()
    486 {
     495sub removeChangeLogArguments($)
     496{
     497    my ($baseDir) = @_;
    487498    my @results = ();
    488499
    489500    for (my $i = 0; $i < scalar(@ARGV); ) {
    490         my $file = findChangeLog($ARGV[$i]);
     501        my $file = findChangeLog(canonicalRelativePath(File::Spec->catfile($baseDir, $ARGV[$i])));
    491502        if (defined $file) {
    492503            splice(@ARGV, $i, 1);
Note: See TracChangeset for help on using the changeset viewer.