Title: [95547] trunk/Tools
Revision
95547
Author
[email protected]
Date
2011-09-20 09:31:16 -0700 (Tue, 20 Sep 2011)

Log Message

ChangeLogEntry class should contain a list of touched files
https://bugs.webkit.org/show_bug.cgi?id=68115

Patch by Leandro Pereira <[email protected]> on 2011-09-20
Reviewed by Eric Seidel.

Add method to return the list of files touched in a ChangeLog entry.

* Scripts/webkitpy/common/checkout/changelog.py: Add
touched_files_regexp and touched_files() method.
* Scripts/webkitpy/common/checkout/changelog_unittest.py: Implement
unit tests for touched_files() method.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (95546 => 95547)


--- trunk/Tools/ChangeLog	2011-09-20 16:27:41 UTC (rev 95546)
+++ trunk/Tools/ChangeLog	2011-09-20 16:31:16 UTC (rev 95547)
@@ -1,3 +1,17 @@
+2011-09-20  Leandro Pereira  <[email protected]>
+
+        ChangeLogEntry class should contain a list of touched files
+        https://bugs.webkit.org/show_bug.cgi?id=68115
+
+        Reviewed by Eric Seidel.
+        
+        Add method to return the list of files touched in a ChangeLog entry.
+
+        * Scripts/webkitpy/common/checkout/changelog.py: Add
+        touched_files_regexp and touched_files() method.
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py: Implement
+        unit tests for touched_files() method.
+
 2011-09-20  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r95526 and r95541.

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py (95546 => 95547)


--- trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py	2011-09-20 16:27:41 UTC (rev 95546)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py	2011-09-20 16:31:16 UTC (rev 95547)
@@ -74,6 +74,9 @@
     # e.g. 2009-06-03  Eric Seidel  <[email protected]>
     date_line_regexp = r'^(?P<date>\d{4}-\d{2}-\d{2})\s+(?P<name>.+?)\s+<(?P<email>[^<>]+)>$'
 
+    # e.g. * Source/WebCore/page/EventHandler.cpp: Implement FooBarQuux.
+    touched_files_regexp = r'\s*\*\s*(?P<file>.+)\:'
+
     # e.g. == Rolled over to ChangeLog-2011-02-16 ==
     rolled_over_regexp = r'^== Rolled over to ChangeLog-\d{4}-\d{2}-\d{2} ==$'
 
@@ -97,6 +100,8 @@
         self._reviewer = self._committer_list.committer_by_name(self._reviewer_text)
         self._author = self._committer_list.contributor_by_email(self._author_email) or self._committer_list.contributor_by_name(self._author_name)
 
+        self._touched_files = re.findall(self.touched_files_regexp, self._contents, re.MULTILINE)
+
     def author_name(self):
         return self._author_name
 
@@ -120,7 +125,10 @@
     def bug_id(self):
         return parse_bug_id_from_changelog(self._contents)
 
+    def touched_files(self):
+        return self._touched_files
 
+
 # FIXME: Various methods on ChangeLog should move into ChangeLogEntry instead.
 class ChangeLog(object):
 

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py (95546 => 95547)


--- trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py	2011-09-20 16:27:41 UTC (rev 95546)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py	2011-09-20 16:31:16 UTC (rev 95547)
@@ -161,6 +161,7 @@
         self.assertEquals(latest_entry.author_name(), "Peter Kasting")
         self.assertEquals(latest_entry.author_email(), "[email protected]")
         self.assertEquals(latest_entry.reviewer_text(), u"Tor Arne Vestb\xf8")
+        self.assertEquals(latest_entry.touched_files(), ["Scripts/modules/cpp_style.py", "Scripts/modules/cpp_style_unittest.py"])
         self.assertTrue(latest_entry.reviewer())  # Make sure that our UTF8-based lookup of Tor works.
 
     def test_latest_entry_parse_single_entry(self):
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to