Skip to content

Commit

Permalink
[git-webkit] Rely on cache when identifier and branch specified
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=262504
rdar://116366226

Reviewed by Aakash Jain.

The 'find' function is used by `git-webkit` and commits.webkit.org to
convert a user provided string into a Commit object. When that string
is an identifier, we split the identifier into it's composite parts and
pass them to the 'commit' function. Ensure we attempt to use our cache
in that situation.

* 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.commit): Attempt to use cache when identifier is integer.

Canonical link: https://commits.webkit.org/268750@main
  • Loading branch information
JonWBedard committed Oct 2, 2023
1 parent de76c63 commit 6a5dbe0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tools/Scripts/libraries/webkitscmpy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def readme():

setup(
name='webkitscmpy',
version='6.6.14',
version='6.6.15',
description='Library designed to interact with git and svn repositories.',
long_description=readme(),
classifiers=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _maybe_add_webkitcorepy_path():
"Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
)

version = Version(6, 6, 14)
version = Version(6, 6, 15)

AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
AutoInstall.register(Package('jinja2', Version(2, 11, 3)))
Expand Down
3 changes: 2 additions & 1 deletion Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,8 @@ def commit(self, hash=None, revision=None, identifier=None, branch=None, tag=Non
),
)
branch = parsed_branch
hash = self.cache.to_hash(identifier='{}@{}'.format(identifier, parsed_branch), branch=branch) if self.cache else None
if branch:
hash = self.cache.to_hash(identifier='{}@{}'.format(identifier, branch), branch=branch) if self.cache else None

# If the cache managed to convert the identifier to a hash, we can skip some computation
if hash:
Expand Down

0 comments on commit 6a5dbe0

Please sign in to comment.