Title: [290747] trunk
Revision
290747
Author
[email protected]
Date
2022-03-02 12:41:37 -0800 (Wed, 02 Mar 2022)

Log Message

[git-webkit] Sync personal fork by default
https://bugs.webkit.org/show_bug.cgi?id=237324
<rdar://problem/89618617>

Reviewed by Dewei Zhu.

* metadata/project_config: Add webkitscmpy.update-fork option.
* Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:
(Git): Add new webkitscmpy.update-fork option.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
(PullRequest.main): If we are rebasing the source branch, we should push that synced branch
to a user's personal fork, if such a fork exists.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py:

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

Modified Paths

Diff

Modified: trunk/ChangeLog (290746 => 290747)


--- trunk/ChangeLog	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/ChangeLog	2022-03-02 20:41:37 UTC (rev 290747)
@@ -1,3 +1,13 @@
+2022-03-01  Jonathan Bedard  <[email protected]>
+
+        [git-webkit] Sync personal fork by default
+        https://bugs.webkit.org/show_bug.cgi?id=237324
+        <rdar://problem/89618617>
+
+        Reviewed by Dewei Zhu.
+
+        * metadata/project_config: Add webkitscmpy.update-fork option.
+
 2022-03-02  Adrian Perez de Castro  <[email protected]>
 
         [CMake] Build failure with libstdc++ (>= 6) when cross-compiling (fatal error: stdlib.h: No such file or directory)

Modified: trunk/Tools/ChangeLog (290746 => 290747)


--- trunk/Tools/ChangeLog	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/Tools/ChangeLog	2022-03-02 20:41:37 UTC (rev 290747)
@@ -1,3 +1,21 @@
+2022-03-02  Jonathan Bedard  <[email protected]>
+
+        [git-webkit] Sync personal fork by default
+        https://bugs.webkit.org/show_bug.cgi?id=237324
+        <rdar://problem/89618617>
+
+        Reviewed by Dewei Zhu.
+
+        * Scripts/libraries/webkitscmpy/setup.py: Bump version.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:
+        (Git): Add new webkitscmpy.update-fork option.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:
+        * Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
+        (PullRequest.main): If we are rebasing the source branch, we should push that synced branch
+        to a user's personal fork, if such a fork exists.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py:
+
 2022-03-02  Chris Dumez  <[email protected]>
 
         Mousemove events double-firing in Safari

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/setup.py (290746 => 290747)


--- trunk/Tools/Scripts/libraries/webkitscmpy/setup.py	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/setup.py	2022-03-02 20:41:37 UTC (rev 290747)
@@ -29,7 +29,7 @@
 
 setup(
     name='webkitscmpy',
-    version='4.3.4',
+    version='4.3.5',
     description='Library designed to interact with git and svn repositories.',
     long_description=readme(),
     classifiers=[

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (290746 => 290747)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2022-03-02 20:41:37 UTC (rev 290747)
@@ -46,7 +46,7 @@
         "Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
     )
 
-version = Version(4, 3, 4)
+version = Version(4, 3, 5)
 
 AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
 AutoInstall.register(Package('jinja2', Version(2, 11, 3)))

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py (290746 => 290747)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py	2022-03-02 20:41:37 UTC (rev 290747)
@@ -307,6 +307,7 @@
         'pull.rebase': ['true', 'false'],
         'webkitscmpy.pull-request': ['overwrite', 'append'],
         'webkitscmpy.history': ['when-user-owned', 'disabled', 'always', 'never'],
+        'webkitscmpy.update-fork': ['true', 'false'],
     }
     CONFIG_LOCATIONS = ['global', 'repository', 'project']
 

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


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py	2022-03-02 20:41:37 UTC (rev 290747)
@@ -466,7 +466,7 @@
                 cwd=self.path,
                 generator=lambda *args, **kwargs: self.add(args[2]),
             ), mocks.Subprocess.Route(
-                self.executable, 'push', '-f',
+                self.executable, 'push', '-f', re.compile(r'.+'), re.compile(r'.+'),
                 cwd=self.path,
                 generator=lambda *args, **kwargs: mocks.ProcessCompletion(returncode=0),
             ), mocks.Subprocess.Route(
@@ -482,9 +482,9 @@
                 cwd=self.path,
                 generator=lambda *args, **kwargs: self.move_branch(args[3], args[4]),
             ), mocks.Subprocess.Route(
-                self.executable, 'push', 'origin', re.compile(r'.+'),
+                self.executable, 'push', re.compile(r'.+'), re.compile(r'.+'),
                 cwd=self.path,
-                generator=lambda *args, **kwargs: self.push(args[2], args[3]),
+                generator=lambda *args, **kwargs: self.push(args[2], args[3].split(':')[0]),
             ), mocks.Subprocess.Route(
                 self.executable, 'diff', re.compile(r'.+'),
                 cwd=self.path,

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py (290746 => 290747)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py	2022-03-02 20:41:37 UTC (rev 290747)
@@ -158,7 +158,8 @@
         if result:
             return result
 
-        if args.rebase or (args.rebase is None and repository.config().get('pull.rebase')):
+        rebasing = args.rebase or (args.rebase is None and repository.config().get('pull.rebase'))
+        if rebasing:
             log.info("Rebasing '{}' on '{}'...".format(repository.branch, branch_point.branch))
             if repository.pull(rebase=True, branch=branch_point.branch):
                 sys.stderr.write("Failed to rebase '{}' on '{},' please resolve conflicts\n".format(repository.branch, branch_point.branch))
@@ -180,6 +181,11 @@
             sys.stderr.write("your checkout may not have permission to push to '{}'\n".format(repository.url(name=target)))
             return 1
 
+        if rebasing and target == 'fork' and repository.config().get('webkitscmpy.update-fork', 'false') == 'true':
+            log.info("Syncing '{}' to remote '{}'".format(branch_point.branch, target))
+            if run([repository.executable(), 'push', target, '{branch}:{branch}'.format(branch=branch_point.branch)], cwd=repository.root_path).returncode:
+                sys.stderr.write("Failed to sync '{}' to '{}.' Error is non fatal, continuing...\n".format(branch_point.branch, target))
+
         if args.history or (target != source_remote and args.history is None and args.technique == 'overwrite'):
             regex = re.compile(r'^{}-(?P<count>\d+)$'.format(repository.branch))
             count = max([

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py (290746 => 290747)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py	2022-03-02 20:41:37 UTC (rev 290747)
@@ -348,6 +348,7 @@
                 "Rebased 'eng/pr-branch' on 'main!'",
                 "    Found 1 commit...",
                 "Pushing 'eng/pr-branch' to 'fork'...",
+                "Syncing 'main' to remote 'fork'",
                 "Creating pull-request for 'eng/pr-branch'...",
             ],
         )
@@ -380,6 +381,7 @@
                 "Rebased 'eng/pr-branch' on 'main!'",
                 "    Found 1 commit...",
                 "Pushing 'eng/pr-branch' to 'fork'...",
+                "Syncing 'main' to remote 'fork'",
                 "Creating pull-request for 'eng/pr-branch'...",
             ],
         )
@@ -415,6 +417,7 @@
                 "Rebased 'eng/pr-branch' on 'main!'",
                 "    Found 1 commit...",
                 "Pushing 'eng/pr-branch' to 'fork'...",
+                "Syncing 'main' to remote 'fork'",
                 "Updating pull-request for 'eng/pr-branch'...",
             ],
         )
@@ -451,6 +454,7 @@
                 '    Found 1 commit...',
                 '    Found 2 commits...',
                 "Pushing 'eng/pr-branch' to 'fork'...",
+                "Syncing 'main' to remote 'fork'",
                 "Updating pull-request for 'eng/pr-branch'...",
             ],
         )
@@ -493,6 +497,7 @@
                 "Rebased 'eng/pr-branch' on 'main!'",
                 "    Found 1 commit...",
                 "Pushing 'eng/pr-branch' to 'fork'...",
+                "Syncing 'main' to remote 'fork'",
                 "Updating pull-request for 'eng/pr-branch'...",
             ],
         )
@@ -543,6 +548,7 @@
                 "Rebased 'eng/pr-branch' on 'main!'",
                 "    Found 1 commit...",
                 "Pushing 'eng/pr-branch' to 'fork'...",
+                "Syncing 'main' to remote 'fork'",
                 "Creating pull-request for 'eng/pr-branch'...",
                 'Checking issue assignee...',
                 'Checking for pull request link in associated issue...',
@@ -596,6 +602,7 @@
                 "Rebased 'eng/pr-branch' on 'main!'",
                 "    Found 1 commit...",
                 "Pushing 'eng/pr-branch' to 'fork'...",
+                "Syncing 'main' to remote 'fork'",
                 "Creating pull-request for 'eng/pr-branch'...",
                 'Checking issue assignee...',
                 'Checking for pull request link in associated issue...',

Modified: trunk/metadata/project_config (290746 => 290747)


--- trunk/metadata/project_config	2022-03-02 20:18:43 UTC (rev 290746)
+++ trunk/metadata/project_config	2022-03-02 20:41:37 UTC (rev 290747)
@@ -3,3 +3,4 @@
 [webkitscmpy]
         pull-request = append
         history = disabled
+        update-fork = true
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to