Changeset 282409 in webkit
- Timestamp:
- Sep 14, 2021, 2:14:59 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/local/git.py (modified) (1 diff)
-
Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py (modified) (1 diff)
-
Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r282404 r282409 1 2021-09-14 Jonathan Bedard <jbedard@apple.com> 2 3 [git-webkit] Reset author time when editing commits (Part 2) 4 https://bugs.webkit.org/show_bug.cgi?id=230224 5 <rdar://problem/83065417> 6 7 Reviewed by Stephanie Lewis. 8 9 * Scripts/libraries/webkitscmpy/setup.py: Bump version. 10 * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto. 11 * Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py: 12 (Git.pull): Force-update ref of pulled branch, reset author time of all rebased commits. 13 * Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py: Add update-ref mock. 14 * Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py: 15 (TestDoPullRequest): 16 1 17 2021-09-14 Jonathan Bedard <jbedard@apple.com> 2 18 -
trunk/Tools/Scripts/libraries/webkitscmpy/setup.py
r282113 r282409 30 30 setup( 31 31 name='webkitscmpy', 32 version='2. 1.3',32 version='2.2.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
r282113 r282409 47 47 ) 48 48 49 version = Version(2, 1, 3)49 version = Version(2, 2, 0) 50 50 51 51 AutoInstall.register(Package('fasteners', Version(0, 15, 0))) -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py
r282113 r282409 769 769 ).returncode else self.commit() 770 770 771 def pull(self, rebase=None, branch=None ):772 commit = self.commit() if self.is_svn else None771 def pull(self, rebase=None, branch=None, remote='origin'): 772 commit = self.commit() if self.is_svn or branch else None 773 773 code = run( 774 774 [self.executable(), 'pull'] + ( 775 [ 'origin', branch] if branch else []775 [remote, branch] if branch else [] 776 776 ) + ( 777 777 [] if rebase is None else ['--rebase={}'.format('True' if rebase else 'False')] 778 778 ), cwd=self.root_path, 779 779 ).returncode 780 781 if not code and branch: 782 code = run( 783 [self.executable(), 'update-ref', branch, '{}/{}'.format(remote, branch)], 784 cwd=self.root_path, 785 ).returncode 786 787 if not code and branch and rebase: 788 result = run([self.executable(), 'rev-parse', 'HEAD'], cwd=self.root_path, capture_output=True, encoding='utf-8') 789 if not result.returncode and result.stdout.rstrip() != commit.hash: 790 code = run([ 791 self.executable(), 792 'filter-branch', '-f', 793 '--env-filter', "GIT_AUTHOR_DATE='{date}';GIT_COMMITTER_DATE='{date}'".format( 794 date='{} -{}'.format(int(time.time()), int(time.localtime().tm_gmtoff * 100 / (60 * 60))) 795 ), 'HEAD...{}'.format('{}/{}'.format(remote, branch)), 796 ], cwd=self.root_path, env={'FILTER_BRANCH_SQUELCH_WARNING': '1'}).returncode 797 780 798 if not code and self.is_svn: 781 799 return run([ -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py
r282404 r282409 432 432 generator=lambda *args, **kwargs: mocks.ProcessCompletion(returncode=0), 433 433 ), mocks.Subprocess.Route( 434 self.executable, 'update-ref', re.compile(r'.+'), re.compile(r'.+'), 435 cwd=self.path, 436 generator=lambda *args, **kwargs: mocks.ProcessCompletion(returncode=0), 437 ), mocks.Subprocess.Route( 434 438 self.executable, 435 439 cwd=self.path, -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py
r281821 r282409 192 192 self.assertEqual(repo.head.hash, 'e4390abc95a2026370b8c9813b7e55c61c5d6ebb') 193 193 194 self.assertEqual(captured.root.log.getvalue(), '''Creating the local development branch 'eng/pr-branch'... 194 self.assertEqual( 195 '\n'.join([line for line in captured.root.log.getvalue().splitlines() if 'Mock process' not in line]), 196 """Creating the local development branch 'eng/pr-branch'... 195 197 Creating commit... 196 198 Found 1 commit... 197 199 Rebasing 'eng/pr-branch' on 'main'... 198 Rebased 'eng/pr-branch' on 'main!' 199 ''') 200 Rebased 'eng/pr-branch' on 'main!'""") 200 201 self.assertEqual(captured.stderr.getvalue(), "'{}' doesn't have a recognized remote\n".format(self.path)) 201 202 … … 212 213 213 214 self.assertEqual(captured.stderr.getvalue(), "'{}' doesn't have a recognized remote\n".format(self.path)) 214 self.assertEqual(captured.root.log.getvalue(), '''Creating the local development branch 'eng/pr-branch'... 215 self.assertEqual( 216 '\n'.join([line for line in captured.root.log.getvalue().splitlines() if 'Mock process' not in line]), 217 """Creating the local development branch 'eng/pr-branch'... 215 218 Adding modified.txt... 216 219 Creating commit... 217 220 Found 1 commit... 218 221 Rebasing 'eng/pr-branch' on 'main'... 219 Rebased 'eng/pr-branch' on 'main!' 220 ''') 222 Rebased 'eng/pr-branch' on 'main!'""") 221 223 222 224 def test_github(self): … … 233 235 log = captured.root.log.getvalue().splitlines() 234 236 self.assertEqual( 235 log[:6] + log[9 if sys.version_info > (3, 0) else 7:], [237 [line for line in log if 'Mock process' not in line], [ 236 238 "Creating the local development branch 'eng/pr-branch'...", 237 239 'Creating commit...', … … 263 265 self.assertEqual(captured.stderr.getvalue(), '') 264 266 log = captured.root.log.getvalue().splitlines() 265 self.assertEqual( 266 log[:5] + log[8 if sys.version_info > (3, 0) else 6:], [ 267 self.maxDiff = None 268 self.assertEqual( 269 [line for line in log if 'Mock process' not in line], [ 267 270 "Amending commit...", 268 271 ' Found 1 commit...', … … 289 292 log = captured.root.log.getvalue().splitlines() 290 293 self.assertEqual( 291 log[:6] + log[9 if sys.version_info > (3, 0) else 7:], [294 [line for line in log if 'Mock process' not in line], [ 292 295 "Creating the local development branch 'eng/pr-branch'...", 293 296 'Creating commit...', … … 322 325 log = captured.root.log.getvalue().splitlines() 323 326 self.assertEqual( 324 log[:5] + log[8 if sys.version_info > (3, 0) else 6:], [327 [line for line in log if 'Mock process' not in line], [ 325 328 "Amending commit...", 326 329 ' Found 1 commit...',
Note:
See TracChangeset
for help on using the changeset viewer.