Summary: | [webkitscmpy] Generate Commit object from local repository | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jonathan Bedard <jbedard> | ||||||||||||
Component: | Tools / Tests | Assignee: | Jonathan Bedard <jbedard> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | dewei_zhu, webkit-bug-importer | ||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=215862 https://bugs.webkit.org/show_bug.cgi?id=216403 https://bugs.webkit.org/show_bug.cgi?id=216402 https://bugs.webkit.org/show_bug.cgi?id=217409 https://bugs.webkit.org/show_bug.cgi?id=218079 |
||||||||||||||
Attachments: |
|
Description
Jonathan Bedard
2020-09-11 04:36:00 PDT
Created attachment 410161 [details]
Patch
Created attachment 410289 [details]
Patch
Comment on attachment 410289 [details]
Patch
This change works, but it doesn't have testing yet. Wanted to put it up for now so it could be discussed.
This change implements the scheme outlined in https://trac.webkit.org/wiki/commit-identifiers. Comment on attachment 410289 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410289&action=review > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py:47 > + keyargs = args + tuple(sorted([(key, value) for key, value in kwargs.items()])) > + last_called = self._last_called[function].get(keyargs, 0) > + is_cached = keyargs in self._cache[function] This might work if kwargs has list as value. For example: kwargs = {'foo': []} Created attachment 410579 [details]
Patch
Created attachment 410584 [details]
Patch
Created attachment 410657 [details]
Patch
(In reply to dewei_zhu from comment #6) > Comment on attachment 410289 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=410289&action=review > > > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/decorators.py:47 > > + keyargs = args + tuple(sorted([(key, value) for key, value in kwargs.items()])) > > + last_called = self._last_called[function].get(keyargs, 0) > > + is_cached = keyargs in self._cache[function] > > This might work if kwargs has list as value. > For example: > kwargs = {'foo': []} The list case does break things, but I think that's fine because the tuple case works. fine. On a more theoretical level, lists shouldn't really work as arguments to memoized functions anyways because they are mutable, we would basically be relying on Python primitives to enforce that rule. r=me. For the issue that arguments pass to Memoize can not be a list, there will be a separate change to address that. (In reply to dewei_zhu from comment #11) > r=me. For the issue that arguments pass to Memoize can not be a list, there > will be a separate change to address that. https://bugs.webkit.org/show_bug.cgi?id=216404 Committed r268080: <https://trac.webkit.org/changeset/268080> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410657 [details]. |