Changeset 62692 in webkit
- Timestamp:
- Jul 7, 2010 1:02:09 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r62688 r62692 1 2010-07-07 David Kilzer <ddkilzer@apple.com> 2 3 <http://webkit.org/b/41788> commit-log-editor: wrong ChangeLog read when invoked from subdir with git 4 5 Reviewed by Anders Carlsson. 6 7 For both svn and git, commit-log-editor is invoked from the root 8 of the working directory. Unlike svn, git returns a list of 9 changed files that are relative to the directory where the 10 command was invoked. This caused the ChangeLog file in the root 11 directory to be read instead of the ChangeLog in the current 12 directory. 13 14 The fix is to use $ENV{PWD} as the base directory when fixing 15 the path to the ChangeLog files. With svn, this has no net 16 effect since $ENV{PWD} is the root of the working directory and 17 the ChangeLog paths are already relative to that directory. 18 With git, $ENV{PWD} is the directory that the commit was invoked 19 from, which fixes the ChangeLog paths so that the correct files 20 are read when creating the commit log entry. 21 22 Note that the call to makeFilePathRelative() was supposed to 23 address this issue, but it doesn't because (a) it does nothing 24 with svn working directories by design, and (b) it does nothing 25 with git working directories because it's invoked when the 26 current directory is the root of the working directory, thus 27 giving no relative path. 28 29 * Scripts/commit-log-editor: Removed call to 30 makeFilePathRelative() since since it does nothing. Moved code 31 to fix up $changeLog path so that it's fixed before trying to 32 open the file, and use $ENV{PWD} as the base path. Also use 33 canonicalizePath() to clean up paths with "../" in them. 34 1 35 2010-07-07 Anders Carlsson <andersca@apple.com> 2 36 -
trunk/WebKitTools/Scripts/commit-log-editor
r57447 r62692 107 107 $existingLog = isGit() && !(/^#/ || /^\s*$/) unless $existingLog; 108 108 109 push @changeLogs, makeFilePathRelative($1)if $inChangesToBeCommitted && (/^(?:M|A)....(.*ChangeLog)\r?\n?$/ || /^#\t(?:modified|new file): (.*ChangeLog)$/) && !/-ChangeLog$/;109 push @changeLogs, $1 if $inChangesToBeCommitted && (/^(?:M|A)....(.*ChangeLog)\r?\n?$/ || /^#\t(?:modified|new file): (.*ChangeLog)$/) && !/-ChangeLog$/; 110 110 } 111 111 close LOG; … … 134 134 my %changeLogContents; 135 135 for my $changeLog (@changeLogs) { 136 $changeLog = File::Spec->abs2rel(canonicalizePath(File::Spec->rel2abs($changeLog, $ENV{PWD})), $topLevel); 137 136 138 open CHANGELOG, $changeLog or die "Can't open $changeLog"; 137 139 my $contents = ""; … … 200 202 close CHANGELOG; 201 203 202 $changeLog = File::Spec->abs2rel(File::Spec->rel2abs($changeLog), $topLevel);203 204 204 my $label = dirname($changeLog); 205 205 $label = "top level" unless length $label;
Note: See TracChangeset
for help on using the changeset viewer.