Changeset 294378 in webkit
- Timestamp:
- May 17, 2022, 6:43:48 PM (4 years ago)
- Location:
- trunk/Tools/Scripts/libraries/webkitscmpy
- Files:
-
- 5 edited
-
setup.py (modified) (1 diff)
-
webkitscmpy/__init__.py (modified) (1 diff)
-
webkitscmpy/local/git.py (modified) (5 diffs)
-
webkitscmpy/mocks/local/git.py (modified) (6 diffs)
-
webkitscmpy/test/git_unittest.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/Scripts/libraries/webkitscmpy/setup.py
r294367 r294378 30 30 setup( 31 31 name='webkitscmpy', 32 version='4.14. 2',32 version='4.14.1', 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
r294367 r294378 47 47 ) 48 48 49 version = Version(4, 14, 2)49 version = Version(4, 14, 1) 50 50 51 51 AutoInstall.register(Package('fasteners', Version(0, 15, 0))) -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py
r294367 r294378 31 31 import time 32 32 33 from datetime import datetime, timedelta 33 34 from collections import defaultdict 34 35 … … 130 131 self._last_populated[branch] = time.time() 131 132 log = subprocess.Popen( 132 [self.repo.executable(), 'log', branch, '--no-decorate' , '--date=unix'],133 [self.repo.executable(), 'log', branch, '--no-decorate'], 133 134 cwd=self.repo.root_path, 134 135 stdout=subprocess.PIPE, … … 555 556 default_branch = self.default_branch 556 557 parsed_branch_point = None 557 log_format = ['-1', '--no-decorate' , '--date=unix'] if include_log else ['-1', '--no-decorate', '--date=unix', '--format=short']558 log_format = ['-1', '--no-decorate'] if include_log else ['-1', '--no-decorate', '--format=short'] 558 559 559 560 # Determine the `git log` output and branch for a given identifier … … 712 713 author = Contributor.from_scm_log(line.lstrip(), self.contributors) 713 714 elif split[0] == 'CommitDate': 714 timestamp = int(line.split(' ')[-1]) 715 tz_diff = line.split(' ')[-1] 716 date = datetime.strptime(split[1].lstrip()[:-len(tz_diff)], '%a %b %d %H:%M:%S %Y ') 717 date += timedelta( 718 hours=int(tz_diff[1:3]), 719 minutes=int(tz_diff[3:5]), 720 ) * (1 if tz_diff[0] == '-' else -1) 721 timestamp = int(calendar.timegm(date.timetuple())) - time.timezone 715 722 716 723 message = '' … … 732 739 log = None 733 740 log = subprocess.Popen( 734 [self.executable(), 'log', '--format=fuller', '--no-decorate', ' --date=unix', '{}...{}'.format(end.hash, begin.hash)],741 [self.executable(), 'log', '--format=fuller', '--no-decorate', '{}...{}'.format(end.hash, begin.hash)], 735 742 cwd=self.root_path, 736 743 stdout=subprocess.PIPE, -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py
r294367 r294378 272 272 ) if self.find(args[2]) else mocks.ProcessCompletion(returncode=128) 273 273 ), mocks.Subprocess.Route( 274 self.executable, 'log', re.compile(r'.+'), '-1', '--no-decorate', '--date=unix',274 self.executable, 'log', re.compile(r'.+'), '-1', '--no-decorate', 275 275 cwd=self.path, 276 276 generator=lambda *args, **kwargs: mocks.ProcessCompletion( … … 285 285 author=self.find(args[2]).author.name, 286 286 email=self.find(args[2]).author.email, 287 date= self.find(args[2]).timestamp,287 date=datetime.utcfromtimestamp(self.find(args[2]).timestamp + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 288 288 log='\n'.join([ 289 289 (' ' + line) if line else '' for line in self.find(args[2]).message.splitlines() … … 297 297 ) if self.find(args[2]) else mocks.ProcessCompletion(returncode=128), 298 298 ), mocks.Subprocess.Route( 299 self.executable, 'log', '--format=fuller', '--no-decorate', '--date=unix',re.compile(r'.+\.\.\..+'),299 self.executable, 'log', '--format=fuller', '--no-decorate', re.compile(r'.+\.\.\..+'), 300 300 cwd=self.path, 301 301 generator=lambda *args, **kwargs: mocks.ProcessCompletion( … … 311 311 author=commit.author.name, 312 312 email=commit.author.email, 313 date= commit.timestamp,313 date=datetime.utcfromtimestamp(commit.timestamp + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 314 314 log='\n'.join([ 315 315 (' ' + line) if line else '' for line in commit.message.splitlines() … … 320 320 commit.revision, 321 321 )] if git_svn else []), 322 )) for commit in list(self.commits_in_range(args[ 5].split('...')[-1], args[5].split('...')[0]))[:-1]322 )) for commit in list(self.commits_in_range(args[4].split('...')[-1], args[4].split('...')[0]))[:-1] 323 323 ]) 324 324 ) … … 336 336 author=commit.author.name, 337 337 email=commit.author.email, 338 date= commit.timestamp if '--date=unix' in args elsedatetime.utcfromtimestamp(commit.timestamp + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'),338 date=datetime.utcfromtimestamp(commit.timestamp + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 339 339 log='\n'.join([ 340 340 (' ' + line) if line else '' for line in commit.message.splitlines() -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/git_unittest.py
r294367 r294378 318 318 self.assertEqual( 319 319 run([ 320 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', ' --date=unix', 'remotes/origin/main...1abe25b4',320 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', 'remotes/origin/main...1abe25b4', 321 321 ], cwd=self.path, capture_output=True, encoding='utf-8').stdout, 322 322 '''commit d8bce26fa65c6fc8f39c17927abb77f69fab82fc … … 338 338 git-svn-id: https://svn.example.org/repository/repository/trunk@8 268f45cc-cd09-0410-ab3c-d52691b4dbfc 339 339 '''.format( 340 time_a= 1601668000,341 time_b= 1601663000,340 time_a=datetime.utcfromtimestamp(1601668000 + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 341 time_b=datetime.utcfromtimestamp(1601663000 + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 342 342 )) 343 343 … … 346 346 self.assertEqual( 347 347 run([ 348 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', ' --date=unix', 'branch-b...main',348 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', 'branch-b...main', 349 349 ], cwd=self.path, capture_output=True, encoding='utf-8').stdout, 350 350 '''commit 790725a6d79e28db2ecdde29548d2262c0bd059d … … 368 368 git-svn-id: https://svn.example.org/repository/repository/trunk@5 268f45cc-cd09-0410-ab3c-d52691b4dbfc 369 369 '''.format( 370 time_a= 1601667000,371 time_b= 1601664000,372 time_c= 1601662000,370 time_a=datetime.utcfromtimestamp(1601667000 + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 371 time_b=datetime.utcfromtimestamp(1601664000 + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 372 time_c=datetime.utcfromtimestamp(1601662000 + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'), 373 373 )) 374 374
Note:
See TracChangeset
for help on using the changeset viewer.