Title: [131450] trunk/Tools
Revision
131450
Author
[email protected]
Date
2012-10-16 07:09:36 -0700 (Tue, 16 Oct 2012)

Log Message

[Qt] Fix determination of changed files from SVN revisions

Reviewed by Csaba Osztrogonác.

isSVN() doesn't work from within the build directory, so change to the source directory before
doing any VCS operations.

* Scripts/VCSUtils.pm:
* Scripts/webkitdirs.pm:
(buildQMakeProjects):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (131449 => 131450)


--- trunk/Tools/ChangeLog	2012-10-16 13:36:15 UTC (rev 131449)
+++ trunk/Tools/ChangeLog	2012-10-16 14:09:36 UTC (rev 131450)
@@ -1,5 +1,18 @@
 2012-10-16  Simon Hausmann  <[email protected]>
 
+        [Qt] Fix determination of changed files from SVN revisions
+
+        Reviewed by Csaba Osztrogonác.
+
+        isSVN() doesn't work from within the build directory, so change to the source directory before
+        doing any VCS operations.
+
+        * Scripts/VCSUtils.pm:
+        * Scripts/webkitdirs.pm:
+        (buildQMakeProjects):
+
+2012-10-16  Simon Hausmann  <[email protected]>
+
         Fix build-webkit bailing out of !isSVN() and !isGit()
 
         Reviewed by Tor Arne Vestbø.

Modified: trunk/Tools/Scripts/VCSUtils.pm (131449 => 131450)


--- trunk/Tools/Scripts/VCSUtils.pm	2012-10-16 13:36:15 UTC (rev 131449)
+++ trunk/Tools/Scripts/VCSUtils.pm	2012-10-16 14:09:36 UTC (rev 131450)
@@ -2107,25 +2107,37 @@
 
 sub listOfChangedFilesBetweenRevisions
 {
-    my ($firstRevision, $lastRevision) = @_;
+    my ($sourceDir, $firstRevision, $lastRevision) = @_;
     my $command;
 
     if ($firstRevision eq "unknown" or $lastRevision eq "unknown") {
         return ();
     }
 
+    # Some VCS functions don't work from within the build dir, so always
+    # go to the source dir first.
+    my $cwd = Cwd::getcwd();
+    chdir $sourceDir;
+
     if (isGit()) {
         my $firstCommit = gitCommitForSVNRevision($firstRevision);
         my $lastCommit = gitCommitForSVNRevision($lastRevision);
         $command = "git diff --name-status $firstCommit..$lastCommit";
     } elsif (isSVN()) {
         $command = "svn diff --summarize -r $firstRevision:$lastRevision";
-    } else {
-        return ();
     }
-    my $diffOutput = `$command`;
-    $diffOutput =~ s/^[A-Z]\s+//gm;
-    return split(/[\r\n]+/, $diffOutput)
+
+    my @result = ();
+
+    if ($command) {
+        my $diffOutput = `$command`;
+        $diffOutput =~ s/^[A-Z]\s+//gm;
+        @result = split(/[\r\n]+/, $diffOutput);
+    }
+
+    chdir $cwd;
+
+    return @result;
 }
 
 

Modified: trunk/Tools/Scripts/webkitdirs.pm (131449 => 131450)


--- trunk/Tools/Scripts/webkitdirs.pm	2012-10-16 13:36:15 UTC (rev 131449)
+++ trunk/Tools/Scripts/webkitdirs.pm	2012-10-16 14:09:36 UTC (rev 131450)
@@ -2326,7 +2326,7 @@
             ", now at revision $svnRevision. Full incremental build needed.\n";
         $needsIncrementalBuild = 1;
 
-        my @fileList = listOfChangedFilesBetweenRevisions($previousSvnRevision, $svnRevision);
+        my @fileList = listOfChangedFilesBetweenRevisions(sourceDir(), $previousSvnRevision, $svnRevision);
 
         foreach (@fileList) {
             if (m/\.pr[oif]$/ or
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to