Diff
Modified: trunk/Tools/ChangeLog (275118 => 275119)
--- trunk/Tools/ChangeLog 2021-03-26 22:41:39 UTC (rev 275118)
+++ trunk/Tools/ChangeLog 2021-03-26 23:10:12 UTC (rev 275119)
@@ -1,3 +1,19 @@
+2021-03-26 Jonathan Bedard <[email protected]>
+
+ [webkit-patch] Use commit.webkit.org instead of remote SVN to compute identifier
+ https://bugs.webkit.org/show_bug.cgi?id=223820
+ <rdar://problem/75902125>
+
+ Reviewed by Dewei Zhu.
+
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ (DownloadCommandsTest.mock_svn_remote): Replace mock Svn with mock requests.
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/comments.py:
+ (bug_comment_from_svn_revision): Use commits.webkit.org instead of svn.webkit.org.
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+ (CloseBugForLandDiffTest.test_empty_state): Replace mock Svn with mock requests.
+
2021-03-26 Don Olmstead <[email protected]>
[CMake] Deprecate using DERIVED_SOURCES_DIR/FOWARDING_HEADERS_DIR directly
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py (275118 => 275119)
--- trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py 2021-03-26 22:41:39 UTC (rev 275118)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py 2021-03-26 23:10:12 UTC (rev 275119)
@@ -1,4 +1,5 @@
# Copyright (C) 2009, 2011 Google Inc. All rights reserved.
+# Copyright (C) 2021 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -35,7 +36,7 @@
from webkitpy.common.checkout.checkout_mock import MockCheckout
from webkitcorepy import OutputCapture
-from webkitscmpy import mocks, Commit
+from webkitcorepy import mocks
class AbstractRevertPrepCommandTest(unittest.TestCase):
@@ -98,21 +99,12 @@
return options
def mock_svn_remote(self):
- repo = mocks.remote.Svn('svn.webkit.org/repository/webkit')
- repo.commits['trunk'].append(Commit(
- author=dict(name='Dmitry Titov', emails=['[email protected]']),
- identifier='5@trunk',
- revision=49824,
- timestamp=1601668000,
- message=
- 'Manual Test for crash caused by JS accessing DOMWindow which is disconnected from the Frame.\n'
- 'https://bugs.webkit.org/show_bug.cgi?id=30544\n'
- '\n'
- 'Reviewed by Darin Adler.\n'
- '\n'
- ' manual-tests/crash-on-accessing-domwindow-without-frame.html: Added.\n',
- ))
- return repo
+ return mocks.Requests('commits.webkit.org', **{
+ 'r49824/json': mocks.Response.fromJson(dict(
+ identifier='5@main',
+ revision=49824,
+ )),
+ })
def test_build(self):
expected_logs = "Updating working directory\nBuilding WebKit\n"
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py (275118 => 275119)
--- trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py 2021-03-26 22:41:39 UTC (rev 275118)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py 2021-03-26 23:10:12 UTC (rev 275119)
@@ -1,5 +1,5 @@
# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2018, 2019 Apple Inc. All rights reserved.
+# Copyright (C) 2018-2021 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -32,7 +32,7 @@
from webkitpy.tool.commands.upload import *
from webkitpy.tool.mocktool import MockOptions, MockTool
-from webkitscmpy import mocks, Commit
+from webkitcorepy import mocks
class UploadCommandsTest(CommandsTest):
@@ -206,14 +206,12 @@
--- End comment ---
"""
- with mocks.remote.Svn('svn.webkit.org/repository/webkit') as repo:
- repo.commits['trunk'].append(Commit(
- author=dict(name='Justin Garcia', emails=['[email protected]']),
- identifier='5@trunk',
+ with mocks.Requests('commits.webkit.org', **{
+ 'r9876/json': mocks.Response.fromJson(dict(
+ identifier='5@main',
revision=9876,
- timestamp=1601668000,
- message='Patch by [email protected]\n Reviewed by darin and hyatt\n',
- ))
+ )),
+ }):
self.assert_execute_outputs(MarkBugFixed(), [], expected_logs=expected_logs, tool=tool, options=options)
def test_edit_changelog(self):
Modified: trunk/Tools/Scripts/webkitpy/tool/comments.py (275118 => 275119)
--- trunk/Tools/Scripts/webkitpy/tool/comments.py 2021-03-26 22:41:39 UTC (rev 275118)
+++ trunk/Tools/Scripts/webkitpy/tool/comments.py 2021-03-26 23:10:12 UTC (rev 275119)
@@ -1,5 +1,5 @@
# Copyright (c) 2009 Google Inc. All rights reserved.
-# Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (c) 2009-2021 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -30,14 +30,16 @@
# A tool for automating dealing with bugzilla, posting patches, committing
# patches, etc.
+import requests
from webkitpy.common.config import urls
-from webkitscmpy import remote
def bug_comment_from_svn_revision(svn_revision):
- repo = remote.Svn('https://svn.webkit.org/repository/webkit')
- identifier = str(repo.commit(revision=svn_revision)).replace('trunk', 'main')
- return 'Committed r{} ({}): <{}>'.format(svn_revision, identifier, urls.view_identifier_url(identifier))
+ repr = 'r{}'.format(svn_revision)
+ response = requests.get('https://commits.webkit.org/{}/json'.format(repr))
+ if response.status_code == 200:
+ repr = response.json().get('identifier', repr)
+ return 'Committed r{} ({}): <{}>'.format(svn_revision, repr if '@' in repr else '?', urls.view_identifier_url(repr))
def bug_comment_from_commit_text(scm, commit_text):
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py (275118 => 275119)
--- trunk/Tools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py 2021-03-26 22:41:39 UTC (rev 275118)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py 2021-03-26 23:10:12 UTC (rev 275119)
@@ -1,5 +1,5 @@
# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2020 Apple Inc. All rights reserved.
+# Copyright (C) 2020-2021 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -33,27 +33,17 @@
from webkitpy.tool.mocktool import MockOptions, MockTool
from webkitpy.tool.steps.closebugforlanddiff import CloseBugForLandDiff
-from webkitcorepy import OutputCapture
-from webkitscmpy import mocks, Commit
+from webkitcorepy import mocks, OutputCapture
class CloseBugForLandDiffTest(unittest.TestCase):
def test_empty_state(self):
- with mocks.remote.Svn('svn.webkit.org/repository/webkit') as repo:
- repo.commits['trunk'].append(Commit(
- author=dict(name='Dmitry Titov', emails=['[email protected]']),
- identifier='5@trunk',
+ with mocks.Requests('commits.webkit.org', **{
+ 'r49824/json': mocks.Response.fromJson(dict(
+ identifier='5@main',
revision=49824,
- timestamp=1601668000,
- message=
- 'Manual Test for crash caused by JS accessing DOMWindow which is disconnected from the Frame.\n'
- 'https://bugs.webkit.org/show_bug.cgi?id=30544\n'
- '\n'
- 'Reviewed by Darin Adler.\n'
- '\n'
- ' manual-tests/crash-on-accessing-domwindow-without-frame.html: Added.\n',
- ))
-
+ )),
+ }):
step = CloseBugForLandDiff(MockTool(), MockOptions())
with OutputCapture(level=logging.INFO) as captured:
step.run(dict(commit_text='Mock commit text'))