Title: [247706] trunk/Tools
Revision
247706
Author
[email protected]
Date
2019-07-22 16:47:16 -0700 (Mon, 22 Jul 2019)

Log Message

resultsdbpy: Handle case where the previous commit doesn't have the changelog
https://bugs.webkit.org/show_bug.cgi?id=200015

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/model/repository.py:
(WebKitRepository.commit_for_id.diff_changelogs): Allow the previous_response to be None.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (247705 => 247706)


--- trunk/Tools/ChangeLog	2019-07-22 23:25:48 UTC (rev 247705)
+++ trunk/Tools/ChangeLog	2019-07-22 23:47:16 UTC (rev 247706)
@@ -1,3 +1,13 @@
+2019-07-22  Jonathan Bedard  <[email protected]>
+
+        resultsdbpy: Handle case where the previous commit doesn't have the changelog
+        https://bugs.webkit.org/show_bug.cgi?id=200015
+
+        Reviewed by Aakash Jain.
+
+        * resultsdbpy/resultsdbpy/model/repository.py:
+        (WebKitRepository.commit_for_id.diff_changelogs): Allow the previous_response to be None.
+
 2019-07-22  Wenson Hsieh  <[email protected]>
 
         [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection

Modified: trunk/Tools/resultsdbpy/resultsdbpy/model/repository.py (247705 => 247706)


--- trunk/Tools/resultsdbpy/resultsdbpy/model/repository.py	2019-07-22 23:25:48 UTC (rev 247705)
+++ trunk/Tools/resultsdbpy/resultsdbpy/model/repository.py	2019-07-22 23:47:16 UTC (rev 247706)
@@ -320,10 +320,13 @@
                     previous_response = self.request(previous_url) if previous_url else None
                     if previous_response and previous_response.status_code != 200:
                         continue
-                    if len(current_response.text) == (len(previous_response.text) if previous_response else 0):
+
+                    previous_response_length = 0
+                    if previous_response:
+                        previous_response_length = len(previous_response.text)
+                    if len(current_response.text) == previous_response_length:
                         continue
-
-                    if len(current_response.text) < (len(previous_response.text) if previous_response else 0):
+                    if not previous_response_length or len(current_response.text) < previous_response_length:
                         changelogs[changelog] = current_response.text
                     else:
                         changelogs[changelog] = current_response.text[0:-len(previous_response.text)]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to