forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[webkitscmpy] Remove "i" from canonical identifier
https://bugs.webkit.org/show_bug.cgi?id=217238 <rdar://problem/69888017> Reviewed by Dewei Zhu. * Scripts/libraries/webkitscmpy/webkitscmpy/commit.py: (Commit): (Commit.pretty_print): Remove "i" from canonical identifier, add branch point. (Commit.__repr__): Remove "i" from canonical identifier. * Scripts/libraries/webkitscmpy/webkitscmpy/test/commit_unittest.py: (TestCommit.test_parse_revision): (TestCommit.test_parse_identifier): (TestCommit.test_parse): (TestCommit.test_pretty_print): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@267895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
037307d
commit ea87d23
Showing
4 changed files
with
56 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
2020-10-02 Jonathan Bedard <[email protected]> | ||
|
||
[webkitscmpy] Remove "i" from canonical identifier | ||
https://bugs.webkit.org/show_bug.cgi?id=217238 | ||
<rdar://problem/69888017> | ||
|
||
Reviewed by Dewei Zhu. | ||
|
||
* Scripts/libraries/webkitscmpy/webkitscmpy/commit.py: | ||
(Commit): | ||
(Commit.pretty_print): Remove "i" from canonical identifier, add branch point. | ||
(Commit.__repr__): Remove "i" from canonical identifier. | ||
* Scripts/libraries/webkitscmpy/webkitscmpy/test/commit_unittest.py: | ||
(TestCommit.test_parse_revision): | ||
(TestCommit.test_parse_identifier): | ||
(TestCommit.test_parse): | ||
(TestCommit.test_pretty_print): | ||
|
||
2020-10-02 Philippe Normand <[email protected]> | ||
|
||
[CMake] unused variable warning spam in UIScriptController.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,50 +46,33 @@ def test_parse_revision(self): | |
self.assertEqual(266896, Commit._parse_revision('266896')) | ||
self.assertEqual(266896, Commit._parse_revision(266896)) | ||
|
||
self.assertEqual(None, Commit._parse_revision('i1234')) | ||
self.assertEqual(None, Commit._parse_revision('c3bd784f8b88bd03')) | ||
self.assertEqual(None, Commit._parse_revision('0')) | ||
self.assertEqual(None, Commit._parse_revision('-1')) | ||
self.assertEqual(None, Commit._parse_revision('3.141592')) | ||
self.assertEqual(None, Commit._parse_revision(3.141592)) | ||
|
||
def test_parse_identifier(self): | ||
self.assertEqual((None, 1234, None), Commit._parse_identifier('i1234')) | ||
self.assertEqual((None, 1234, None), Commit._parse_identifier('I1234')) | ||
self.assertEqual((None, 1234, None), Commit._parse_identifier('1234')) | ||
self.assertEqual((None, 1234, None), Commit._parse_identifier(1234)) | ||
|
||
self.assertEqual((None, 1234, 'main'), Commit._parse_identifier('i1234@main')) | ||
self.assertEqual((None, 1234, 'main'), Commit._parse_identifier('I1234@main')) | ||
self.assertEqual((None, 1234, 'main'), Commit._parse_identifier('1234@main')) | ||
|
||
self.assertEqual((None, 1234, 'eng/bug'), Commit._parse_identifier('i1234@eng/bug')) | ||
self.assertEqual((None, 1234, 'eng/bug'), Commit._parse_identifier('I1234@eng/bug')) | ||
self.assertEqual((None, 1234, 'eng/bug'), Commit._parse_identifier('1234@eng/bug')) | ||
|
||
self.assertEqual((1234, 1, 'eng/bug'), Commit._parse_identifier('i1234.1@eng/bug')) | ||
self.assertEqual((1234, 1, 'eng/bug'), Commit._parse_identifier('I1234.1@eng/bug')) | ||
self.assertEqual((1234, 1, 'eng/bug'), Commit._parse_identifier('1234.1@eng/bug')) | ||
|
||
self.assertEqual((None, 0, None), Commit._parse_identifier('0')) | ||
self.assertEqual((None, -1, None), Commit._parse_identifier('-1')) | ||
|
||
self.assertEqual((None, 0, 'eng/bug'), Commit._parse_identifier('i0@eng/bug')) | ||
self.assertEqual((None, 0, 'eng/bug'), Commit._parse_identifier('I0@eng/bug')) | ||
self.assertEqual((None, 0, 'eng/bug'), Commit._parse_identifier('0@eng/bug')) | ||
|
||
self.assertEqual((None, -1, 'eng/bug'), Commit._parse_identifier('i-1@eng/bug')) | ||
self.assertEqual((None, -1, 'eng/bug'), Commit._parse_identifier('I-1@eng/bug')) | ||
self.assertEqual((None, -1, 'eng/bug'), Commit._parse_identifier('-1@eng/bug')) | ||
|
||
self.assertEqual(None, Commit._parse_identifier('i1234-invalid')) | ||
self.assertEqual(None, Commit._parse_identifier('1234-invalid')) | ||
self.assertEqual(None, Commit._parse_identifier('r266896')) | ||
self.assertEqual(None, Commit._parse_identifier('c3bd784f8b88bd03')) | ||
self.assertEqual(None, Commit._parse_identifier(3.141592)) | ||
|
||
def test_parse(self): | ||
self.assertEqual(Commit.parse('i123@main'), Commit(identifier=123, branch='main')) | ||
self.assertEqual(Commit.parse('i123'), Commit(identifier=123)) | ||
self.assertEqual(Commit.parse('123@main'), Commit(identifier=123, branch='main')) | ||
self.assertEqual(Commit.parse('123'), Commit(identifier=123)) | ||
|
||
self.assertEqual(Commit.parse('r123'), Commit(revision=123)) | ||
|
@@ -102,54 +85,69 @@ def test_parse(self): | |
def test_pretty_print(self): | ||
self.assertEqual( | ||
Commit( | ||
identifier='i123@master', | ||
identifier='123@master', | ||
hash='c3bd784f8b88bd03f64467ddd3304ed8be28acbe', | ||
author=Contributor('Jonathan Bedard', ['[email protected]']), | ||
message='NOT PRINTED', | ||
).pretty_print(), | ||
'''i123@master | ||
'''123@master | ||
git hash: c3bd784f8b88 on master | ||
identifier: i123 on master | ||
identifier: 123 on master | ||
by Jonathan Bedard <[email protected]> | ||
''', | ||
) | ||
|
||
self.assertEqual( | ||
Commit( | ||
identifier='i123@trunk', | ||
identifier='123@trunk', | ||
revision='r123', | ||
author=Contributor('Jonathan Bedard', ['[email protected]']), | ||
timestamp=1000, | ||
message='NOT PRINTED', | ||
).pretty_print(), | ||
'''i123@trunk | ||
'''123@trunk | ||
SVN revision: r123 on trunk | ||
identifier: i123 on trunk | ||
identifier: 123 on trunk | ||
by Jonathan Bedard <[email protected]> @ {} | ||
'''.format(datetime.utcfromtimestamp(1000)), | ||
) | ||
|
||
self.assertEqual( | ||
Commit( | ||
identifier='123.1@branch-a', | ||
revision='r124', | ||
author=Contributor('Jonathan Bedard', ['[email protected]']), | ||
timestamp=1000, | ||
message='NOT PRINTED', | ||
).pretty_print(), | ||
'''123.1@branch-a | ||
SVN revision: r124 on branch-a | ||
identifier: 1 on branch-a branched from 123 | ||
by Jonathan Bedard <[email protected]> @ {} | ||
'''.format(datetime.utcfromtimestamp(1000)), | ||
) | ||
|
||
self.assertEqual( | ||
Commit( | ||
identifier='i123@trunk', | ||
identifier='123@trunk', | ||
revision='r123', | ||
author=Contributor('Jonathan Bedard', ['[email protected]']), | ||
timestamp=1000, | ||
message='PRINTED\n', | ||
).pretty_print(message=True), | ||
'''i123@trunk | ||
'''123@trunk | ||
SVN revision: r123 on trunk | ||
identifier: i123 on trunk | ||
identifier: 123 on trunk | ||
by Jonathan Bedard <[email protected]> @ {} | ||
PRINTED | ||
'''.format(datetime.utcfromtimestamp(1000)), | ||
) | ||
|
||
def test_repr(self): | ||
self.assertEqual(str(Commit(identifier=123, branch='main')), 'i123@main') | ||
self.assertEqual(str(Commit(branch_point=1234, identifier=1, branch='eng/1234')), 'i1234.1@eng/1234') | ||
self.assertEqual(str(Commit(identifier=123)), 'i123') | ||
self.assertEqual(str(Commit(identifier=123, branch='main')), '123@main') | ||
self.assertEqual(str(Commit(branch_point=1234, identifier=1, branch='eng/1234')), '1234.1@eng/1234') | ||
self.assertEqual(str(Commit(identifier=123)), '123') | ||
|
||
self.assertEqual(str(Commit(revision=123)), 'r123') | ||
|
||
|