Title: [293545] trunk/Tools
Revision
293545
Author
jbed...@apple.com
Date
2022-04-27 16:42:12 -0700 (Wed, 27 Apr 2022)

Log Message

[git-webkit] Cleanup PRs on alternate remotes
https://bugs.webkit.org/show_bug.cgi?id=239814
<rdar://problem/92410887>

Reviewed by Aakash Jain.

* Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/clean.py:
(Clean.parser): Add --remote argument.
(Clean.cleanup): Allow caller to specify remote.
(Clean.main): Pass remote to cleanup.

Canonical link: https://commits.webkit.org/250065@main

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (293544 => 293545)


--- trunk/Tools/ChangeLog	2022-04-27 23:36:54 UTC (rev 293544)
+++ trunk/Tools/ChangeLog	2022-04-27 23:42:12 UTC (rev 293545)
@@ -1,5 +1,20 @@
 2022-04-27  Jonathan Bedard  <jbed...@apple.com>
 
+        [git-webkit] Cleanup PRs on alternate remotes
+        https://bugs.webkit.org/show_bug.cgi?id=239814
+        <rdar://problem/92410887>
+
+        Reviewed by Aakash Jain.
+
+        * Scripts/libraries/webkitscmpy/setup.py: Bump version.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/program/clean.py:
+        (Clean.parser): Add --remote argument.
+        (Clean.cleanup): Allow caller to specify remote.
+        (Clean.main): Pass remote to cleanup.
+
+2022-04-27  Jonathan Bedard  <jbed...@apple.com>
+
         [ews-build.webkit.org] Support alternative remotes (Follow-up fix)
         https://bugs.webkit.org/show_bug.cgi?id=239617
         <rdar://problem/92115230>

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/setup.py (293544 => 293545)


--- trunk/Tools/Scripts/libraries/webkitscmpy/setup.py	2022-04-27 23:36:54 UTC (rev 293544)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/setup.py	2022-04-27 23:42:12 UTC (rev 293545)
@@ -29,7 +29,7 @@
 
 setup(
     name='webkitscmpy',
-    version='4.11.3',
+    version='4.11.4',
     description='Library designed to interact with git and svn repositories.',
     long_description=readme(),
     classifiers=[

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (293544 => 293545)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2022-04-27 23:36:54 UTC (rev 293544)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2022-04-27 23:42:12 UTC (rev 293545)
@@ -46,7 +46,7 @@
         "Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
     )
 
-version = Version(4, 11, 3)
+version = Version(4, 11, 4)
 
 AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
 AutoInstall.register(Package('jinja2', Version(2, 11, 3)))

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/clean.py (293544 => 293545)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/clean.py	2022-04-27 23:36:54 UTC (rev 293544)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/clean.py	2022-04-27 23:42:12 UTC (rev 293545)
@@ -41,15 +41,24 @@
             type=str, default=None,
             help='String representation(s) of a commit or branch to be cleaned',
         )
+        parser.add_argument(
+            '--remote', dest='remote', type=str, default=None,
+            help='Specify remote to search for pull request from.',
+        )
 
     @classmethod
-    def cleanup(cls, repository, argument):
+    def cleanup(cls, repository, argument, remote_target=None):
         if not repository.is_git:
             sys.stderr('Can only cleanup branches on git repositories\n')
             return 1
 
-        rmt = repository.remote()
-        target = 'fork' if isinstance(rmt, remote.GitHub) else 'origin'
+        rmt = repository.remote(name=remote_target)
+        if isinstance(rmt, remote.GitHub) and remote_target in (None, 'origin'):
+            target = 'fork'
+        elif isinstance(rmt, remote.GitHub):
+            target = '{}-fork'.format(remote_target)
+        else:
+            target = 'origin'
 
         match = cls.PR_RE.match(argument)
         if match:
@@ -103,5 +112,5 @@
 
         result = 0
         for argument in args.arguments:
-            result += cls.cleanup(repository, argument)
+            result += cls.cleanup(repository, argument, remote_target=args.remote)
         return result
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to