Changeset 185710 in webkit
- Timestamp:
- Jun 18, 2015 11:00:11 AM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r185708 r185710 1 2015-06-18 Daniel Bates <dabates@apple.com> 2 3 Make webkitdirs::runGitUpdate() work when invoked in more than one Git checkout 4 https://bugs.webkit.org/show_bug.cgi?id=146082 5 6 Reviewed by Darin Adler. 7 8 The function webkitdirs::runGitUpdate may not update the Git checkout in the current 9 working directory after being invoked in a different Git checkout. In particular, 10 calling runGitUpdate() inside a Git SVN checkout and subsequently calling it inside 11 a pure Git checkout g will fail to update g. 12 13 Currently webkitdirs::runGitUpdate() calls VCSUtils::isGitSVN() to determine whether 14 the current working directory is a Git SVN checkout. And isGitSVN() caches its result 15 to speed up subsequent queries. This prevents runGitUpdate() from being used to update 16 an arbitrary Git checkout (since isGitSVN() may return a cached result for a directory 17 different than the current working directory). Instead runGitUpdate() should check 18 whether the current working directory is a Git SVN checkout on each invocation. 19 20 * Scripts/VCSUtils.pm: Export function isGitSVNDirectory so that it can be used from webkitdirs::runGitUpdate(). 21 (isGitSVNDirectory): Extracted logic to determine whether a directory is a Git 22 SVN directory from isGitSVN(). 23 (isGitSVN): Implemented in terms of isGitSVNDirectory(). 24 * Scripts/webkitdirs.pm: 25 (runGitUpdate): Modified to use isGitSVNDirectory(). 26 1 27 2015-06-18 Mark Lam <mark.lam@apple.com> 2 28 -
trunk/Tools/Scripts/VCSUtils.pm
r185664 r185710 67 67 &isGitBranchBuild 68 68 &isGitDirectory 69 &isGitSVNDirectory 69 70 &isSVN 70 71 &isSVNDirectory … … 225 226 } 226 227 227 sub isGitSVN() 228 { 229 return $isGitSVN if defined $isGitSVN; 228 sub isGitSVNDirectory($) 229 { 230 my ($directory) = @_; 231 232 my $savedWorkingDirectory = Cwd::getcwd(); 233 chdir($directory); 230 234 231 235 # There doesn't seem to be an officially documented way to determine … … 234 238 my $output = `git config --get svn-remote.svn.fetch 2>& 1`; 235 239 $isGitSVN = $output ne ''; 240 chdir($savedWorkingDirectory); 241 return $isGitSVN; 242 } 243 244 sub isGitSVN() 245 { 246 return $isGitSVN if defined $isGitSVN; 247 248 $isGitSVN = isGitSVNDirectory("."); 236 249 return $isGitSVN; 237 250 } -
trunk/Tools/Scripts/webkitdirs.pm
r184202 r185710 2495 2495 # to perform the rebase much much faster. 2496 2496 system("git", "fetch"); 2497 if (isGitSVN ()) {2497 if (isGitSVNDirectory(".")) { 2498 2498 system("git", "svn", "rebase") == 0 or die; 2499 2499 } else {
Note: See TracChangeset
for help on using the changeset viewer.