Bug 9395 - Make prepare-ChangeLog faster
Summary: Make prepare-ChangeLog faster
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
: 6445 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-10 14:29 PDT by David Kilzer (:ddkilzer)
Modified: 2006-06-11 16:45 PDT (History)
1 user (show)

See Also:


Attachments
Patch v1 (6.15 KB, patch)
2006-06-10 14:42 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (6.12 KB, patch)
2006-06-11 12:12 PDT, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2006-06-10 14:29:35 PDT
Currently, prepare-ChangeLog does the following time-consuming things:

1. Runs "svn stat" on the entire WebKit directory to find the files that have changed.
2. Runs "svn diff" only on the files that were changed from Step 1 to find the changed lines.
3. Runs "svn diff" on the entire LayoutTests directory if there are any changes to WebCore to find out if any tests have been changed or been added.

Since "svn diff" runs much faster than "svn stat" on the entire WebKit directory, the following speeds up prepare-ChangeLog from about 2.5 minutes to just under 1 minute on a recent test (Bug 9394):

1. Run "svn diff" on the entire WebKit directory and save the output to a temp file.  Then run "svn stat" only on the changed files from Step 1.
2. Use the the temp file from Step 1 to find the changed lines.
3. Set a variable ($changedLayoutTests) during "svn stat" for Step 1 to determine if any changes have been made to LayoutTests, saving the need to run "svn diff LayoutTests" later.
Comment 1 David Kilzer (:ddkilzer) 2006-06-10 14:42:19 PDT
Created attachment 8800 [details]
Patch v1

In addition to the changes from Comment #0:

- Added -h|--help command-line switch and help message.
- Moved up check for no changed files closer to the beginning of the script.
Comment 2 Geoffrey Garen 2006-06-11 11:05:26 PDT
Sweet!

This patch looks good to me, but I'd like someone with more perl fu to give it a once-over.

I think this
+                  $changedLayoutTests = 1 if !$changedLayoutTests && $components[0] eq "LayoutTests";
would be clearer as this
+                  $changedLayoutTests = 1 if $components[0] eq "LayoutTests";
Comment 3 David Kilzer (:ddkilzer) 2006-06-11 12:12:49 PDT
Created attachment 8811 [details]
Patch v2

Same as Patch v1, but adjusted with feedback from Comment #2.
Comment 4 David Kilzer (:ddkilzer) 2006-06-11 12:14:42 PDT
(In reply to comment #2)
> +                  $changedLayoutTests = 1 if $components[0] eq "LayoutTests";

I could also have made it:

> +                  $changedLayoutTests ||= ($components[0] eq "LayoutTests");

:)
Comment 5 Rob Buis 2006-06-11 12:22:08 PDT
I think bug 6445 is a duplicate of this.
Cheers,

Rob.
Comment 6 David Kilzer (:ddkilzer) 2006-06-11 12:31:09 PDT
*** Bug 6445 has been marked as a duplicate of this bug. ***
Comment 7 Darin Adler 2006-06-11 16:23:36 PDT
Comment on attachment 8811 [details]
Patch v2

Looks good. r=me
Comment 8 David Kilzer (:ddkilzer) 2006-06-11 16:45:31 PDT
Committed revision 14814.

Had to make a minor change to the patch so that "OOPS" didn't appear in the prepare-ChangeLog file:

Transmitting file data ..subversion/libsvn_client/commit.c:873: (apr_err=165001)
svn: Commit failed (details follow):
/SourceCache/subversion/subversion-3/subversion/subversion/libsvn_repos/hooks.c:106: (apr_err=165001)
svn: 'pre-commit' hook failed with error output:
svnlook: Can't write to stream: Broken pipe

    The following ChangeLog files contain OOPS:

        trunk/WebKitTools/Scripts/prepare-ChangeLog

    Please don't ever say "OOPS" in a ChangeLog file.