Changeset 294367 in webkit
- Timestamp:
- May 17, 2022 5:20:12 PM (2 years ago)
- Location:
- trunk/Tools/Scripts/libraries/webkitscmpy
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/Scripts/libraries/webkitscmpy/setup.py
r294038 r294367 30 30 setup( 31 31 name='webkitscmpy', 32 version='4.14. 1',32 version='4.14.2', 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
r294038 r294367 47 47 ) 48 48 49 version = Version(4, 14, 1)49 version = Version(4, 14, 2) 50 50 51 51 AutoInstall.register(Package('fasteners', Version(0, 15, 0))) -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py
r293557 r294367 31 31 import time 32 32 33 from datetime import datetime, timedelta34 33 from collections import defaultdict 35 34 … … 131 130 self._last_populated[branch] = time.time() 132 131 log = subprocess.Popen( 133 [self.repo.executable(), 'log', branch, '--no-decorate' ],132 [self.repo.executable(), 'log', branch, '--no-decorate', '--date=unix'], 134 133 cwd=self.repo.root_path, 135 134 stdout=subprocess.PIPE, … … 556 555 default_branch = self.default_branch 557 556 parsed_branch_point = None 558 log_format = ['-1', '--no-decorate' ] if include_log else ['-1', '--no-decorate', '--format=short']557 log_format = ['-1', '--no-decorate', '--date=unix'] if include_log else ['-1', '--no-decorate', '--date=unix', '--format=short'] 559 558 560 559 # Determine the `git log` output and branch for a given identifier … … 713 712 author = Contributor.from_scm_log(line.lstrip(), self.contributors) 714 713 elif split[0] == 'CommitDate': 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 714 timestamp = int(line.split(' ')[-1]) 722 715 723 716 message = '' … … 739 732 log = None 740 733 log = subprocess.Popen( 741 [self.executable(), 'log', '--format=fuller', '--no-decorate', ' {}...{}'.format(end.hash, begin.hash)],734 [self.executable(), 'log', '--format=fuller', '--no-decorate', '--date=unix', '{}...{}'.format(end.hash, begin.hash)], 742 735 cwd=self.root_path, 743 736 stdout=subprocess.PIPE, -
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py
r293831 r294367 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', 274 self.executable, 'log', re.compile(r'.+'), '-1', '--no-decorate', '--date=unix', 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= datetime.utcfromtimestamp(self.find(args[2]).timestamp + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'),287 date=self.find(args[2]).timestamp, 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', re.compile(r'.+\.\.\..+'),299 self.executable, 'log', '--format=fuller', '--no-decorate', '--date=unix', 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= datetime.utcfromtimestamp(commit.timestamp + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'),313 date=commit.timestamp, 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[ 4].split('...')[-1], args[4].split('...')[0]))[:-1]322 )) for commit in list(self.commits_in_range(args[5].split('...')[-1], args[5].split('...')[0]))[:-1] 323 323 ]) 324 324 ) … … 336 336 author=commit.author.name, 337 337 email=commit.author.email, 338 date= datetime.utcfromtimestamp(commit.timestamp + time.timezone).strftime('%a %b %d %H:%M:%S %Y +0000'),338 date=commit.timestamp if '--date=unix' in args else 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
r292844 r294367 318 318 self.assertEqual( 319 319 run([ 320 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', ' remotes/origin/main...1abe25b4',320 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', '--date=unix', '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= 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'),340 time_a=1601668000, 341 time_b=1601663000, 342 342 )) 343 343 … … 346 346 self.assertEqual( 347 347 run([ 348 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', ' branch-b...main',348 local.Git.executable(), 'log', '--format=fuller', '--no-decorate', '--date=unix', '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= 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'),370 time_a=1601667000, 371 time_b=1601664000, 372 time_c=1601662000, 373 373 )) 374 374
Note: See TracChangeset
for help on using the changeset viewer.