Title: [270956] trunk/Tools
Revision
270956
Author
[email protected]
Date
2020-12-17 15:30:19 -0800 (Thu, 17 Dec 2020)

Log Message

[webkitscmpy] Correct mock `git log` call in standard git repositories
https://bugs.webkit.org/show_bug.cgi?id=219992
<rdar://problem/72436380>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py: git_svn flag should only
control the final line of the message, not the existence of the entire message.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py:
(TestFind.test_basic_git):
(TestFind.test_identifier_git):
(TestFind.test_identifier_git_svn):
(TestFind.test_hash):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (270955 => 270956)


--- trunk/Tools/ChangeLog	2020-12-17 23:21:58 UTC (rev 270955)
+++ trunk/Tools/ChangeLog	2020-12-17 23:30:19 UTC (rev 270956)
@@ -1,3 +1,20 @@
+2020-12-17  Jonathan Bedard  <[email protected]>
+
+        [webkitscmpy] Correct mock `git log` call in standard git repositories
+        https://bugs.webkit.org/show_bug.cgi?id=219992
+        <rdar://problem/72436380>
+
+        Reviewed by Dewei Zhu.
+
+        * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py: git_svn flag should only
+        control the final line of the message, not the existence of the entire message.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py:
+        (TestFind.test_basic_git):
+        (TestFind.test_identifier_git):
+        (TestFind.test_identifier_git_svn):
+        (TestFind.test_hash):
+
 2020-12-17  Sam Sneddon  <[email protected]>
 
         Stop parsing reftest.list files

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (270955 => 270956)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2020-12-17 23:21:58 UTC (rev 270955)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2020-12-17 23:30:19 UTC (rev 270956)
@@ -46,7 +46,7 @@
         "Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
     )
 
-version = Version(0, 6, 3)
+version = Version(0, 6, 4)
 
 AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
 AutoInstall.register(Package('monotonic', Version(1, 5)))

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py (270955 => 270956)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py	2020-12-17 23:21:58 UTC (rev 270955)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py	2020-12-17 23:30:19 UTC (rev 270956)
@@ -196,11 +196,11 @@
                             date=datetime.fromtimestamp(self.find(args[2]).timestamp).strftime('%a %b %d %H:%M:%S %Y'),
                             log='\n'.join([
                                     ('    ' + line) if line else '' for line in self.find(args[2]).message.splitlines()
-                                ] + ['git-svn-id: https://svn.{}/repository/{}/trunk@{} 268f45cc-cd09-0410-ab3c-d52691b4dbfc'.format(
+                                ] + (['git-svn-id: https://svn.{}/repository/{}/trunk@{} 268f45cc-cd09-0410-ab3c-d52691b4dbfc'.format(
                                     self.remote.split('@')[-1].split(':')[0],
                                     os.path.basename(path),
                                     self.find(args[2]).revision,
-                                )] if git_svn else [],
+                                )] if git_svn else []),
                             )
                         ),
                 ) if self.find(args[2]) else mocks.ProcessCompletion(returncode=128),

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py (270955 => 270956)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py	2020-12-17 23:21:58 UTC (rev 270955)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py	2020-12-17 23:30:19 UTC (rev 270956)
@@ -38,7 +38,7 @@
                 args=('find', 'HEAD', '-q'),
                 path=self.path,
             ))
-        self.assertEqual(captured.stdout.getvalue(), '4@main | bae5d1e90999\n')
+        self.assertEqual(captured.stdout.getvalue(), '4@main | bae5d1e90999 | 6th commit\n')
 
     def test_basic_git_svn(self):
         with OutputCapture() as captured, mocks.local.Git(self.path, git_svn=True), mocks.local.Svn(), MockTime:
@@ -78,7 +78,7 @@
                 args=('find', '2@main', '-q'),
                 path=self.path,
             ))
-        self.assertEqual(captured.stdout.getvalue(), '2@main | fff83bb2d917\n')
+        self.assertEqual(captured.stdout.getvalue(), '2@main | fff83bb2d917 | 2nd commit\n')
 
     def test_identifier_git_svn(self):
         with OutputCapture() as captured, mocks.local.Git(self.path), mocks.local.Svn(), MockTime:
@@ -86,7 +86,7 @@
                 args=('find', '2@main', '-q'),
                 path=self.path,
             ))
-        self.assertEqual(captured.stdout.getvalue(), '2@main | fff83bb2d917\n')
+        self.assertEqual(captured.stdout.getvalue(), '2@main | fff83bb2d917 | 2nd commit\n')
 
     def test_identifier_svn(self):
         with OutputCapture() as captured, mocks.local.Git(), mocks.local.Svn(self.path), MockTime:
@@ -102,7 +102,7 @@
                 args=('find', '3cd32e352410', '-q'),
                 path=self.path,
             ))
-        self.assertEqual(captured.stdout.getvalue(), '2.2@branch-b | 3cd32e352410\n')
+        self.assertEqual(captured.stdout.getvalue(), '2.2@branch-b | 3cd32e352410 | 5th commit\n')
 
     def test_revision_svn(self):
         with OutputCapture() as captured, mocks.local.Git(), mocks.local.Svn(self.path), MockTime:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to