Changeset 287853 in webkit
- Timestamp:
- Jan 10, 2022, 1:09:28 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/libraries/webkitscmpy/setup.py (modified) (1 diff)
-
Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (modified) (1 diff)
-
Scripts/libraries/webkitscmpy/webkitscmpy/program/land.py (modified) (1 diff)
-
Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py (modified) (3 diffs)
-
Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r287849 r287853 1 2021-12-17 Jonathan Bedard <jbedard@apple.com> 2 3 [git-webkit] Retain old commits in pull-request 4 https://bugs.webkit.org/show_bug.cgi?id=234453 5 <rdar://problem/86654956> 6 7 Reviewed by Dewei Zhu. 8 9 * Scripts/libraries/webkitscmpy/setup.py: Bump version. 10 * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto. 11 * Scripts/libraries/webkitscmpy/webkitscmpy/program/land.py: 12 (Land.main): Find all numbered branches for landing pull-request. 13 * Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py: 14 (PullRequest.parser): Add history option. 15 (PullRequest.main): Add a numbered branch which persists through the life of the pull-request. 16 1 17 2022-01-10 Wenson Hsieh <wenson_hsieh@apple.com> 2 18 -
trunk/Tools/Scripts/libraries/webkitscmpy/setup.py
r287587 r287853 30 30 setup( 31 31 name='webkitscmpy', 32 version='3. 0.7',32 version='3.1.0', 33 33 description='Library designed to interact with git and svn repositories.', 34 34 long_description=readme(), -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py
r287587 r287853 47 47 ) 48 48 49 version = Version(3, 0, 7)49 version = Version(3, 1, 0) 50 50 51 51 AutoInstall.register(Package('fasteners', Version(0, 15, 0))) -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/land.py
r286295 r287853 233 233 234 234 if args.defaults or Terminal.choose("Delete branch '{}'?".format(source_branch), default='Yes') == 'Yes': 235 run([repository.executable(), 'branch', '-D', source_branch], cwd=repository.root_path) 236 run([repository.executable(), 'push', remote_target, '--delete', source_branch], cwd=repository.root_path) 235 regex = re.compile(r'^{}-(?P<count>\d+)$'.format(repository.branch)) 236 for to_delete in repository.branches_for(remote='fork'): 237 if to_delete == source_branch or regex.match(to_delete): 238 run([repository.executable(), 'branch', '-D', to_delete], cwd=repository.root_path) 239 run([repository.executable(), 'push', remote_target, '--delete', to_delete], cwd=repository.root_path) 237 240 return 0 -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py
r287587 r287853 22 22 23 23 import os 24 import re 24 25 import sys 25 26 … … 54 55 '--defaults', '--no-defaults', action=arguments.NoAction, default=None, 55 56 help='Do not prompt the user for defaults, always use (or do not use) them', 57 ) 58 parser.add_argument( 59 '--with-history', '--no-history', 60 dest='history', default=None, 61 help='Create numbered branches to track the history of a change', 62 action=arguments.NoAction, 56 63 ) 57 64 … … 131 138 sys.stderr.write("Failed to push '{}' to '{}'\n".format(repository.branch, target)) 132 139 return 1 140 141 if args.history or (target != 'origin' and args.history is None): 142 regex = re.compile(r'^{}-(?P<count>\d+)$'.format(repository.branch)) 143 count = max([ 144 int(regex.match(branch).group('count')) if regex.match(branch) else 0 for branch in 145 repository.branches_for(remote=target) 146 ] + [0]) + 1 147 148 history_branch = '{}-{}'.format(repository.branch, count) 149 log.info("Creating '{}' as a reference branch".format(history_branch)) 150 if run([ 151 repository.executable(), 'branch', history_branch, repository.branch, 152 ], cwd=repository.root_path).returncode or run([ 153 repository.executable(), 'push', '-f', target, history_branch, 154 ], cwd=repository.root_path).returncode: 155 sys.stderr.write("Failed to create and push '{}' to '{}'\n".format(history_branch, target)) 133 156 134 157 if not rmt.pull_requests: -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py
r286295 r287853 323 323 repo.staged['added.txt'] = 'added' 324 324 self.assertEqual(0, program.main( 325 args=('pull-request', '-i', 'pr-branch', '-v' ),325 args=('pull-request', '-i', 'pr-branch', '-v', '--no-history'), 326 326 path=self.path, 327 327 )) … … 359 359 repo.staged['added.txt'] = 'diff' 360 360 self.assertEqual(0, program.main( 361 args=('pull-request', '-v' ),361 args=('pull-request', '-v', '--no-history'), 362 362 path=self.path, 363 363 )) … … 393 393 repo.staged['added.txt'] = 'diff' 394 394 self.assertEqual(0, program.main( 395 args=('pull-request', '-v' ),395 args=('pull-request', '-v', '--no-history'), 396 396 path=self.path, 397 397 ))
Note:
See TracChangeset
for help on using the changeset viewer.