RESOLVED FIXED 216404
[webkitscmpy] Generate Commit object from local repository
https://bugs.webkit.org/show_bug.cgi?id=216404
Summary [webkitscmpy] Generate Commit object from local repository
Jonathan Bedard
Reported 2020-09-11 04:36:00 PDT
Add code to generate a commit object from a local Svn or Git repository. Note that this is the first introduction of a functional commit identifier, which is defined as a per-branch monotonically increasing integer. This identifier is distinct from Svn's revision, since identifiers only increase when a change is made to the specific branch an identifier is tracking, rather than to any branch in the repository.
Attachments
Patch (45.39 KB, patch)
2020-09-30 15:56 PDT, Jonathan Bedard
no flags
Patch (31.46 KB, patch)
2020-10-01 17:33 PDT, Jonathan Bedard
no flags
Patch (68.62 KB, patch)
2020-10-05 16:18 PDT, Jonathan Bedard
no flags
Patch (68.64 KB, patch)
2020-10-05 16:28 PDT, Jonathan Bedard
no flags
Patch (75.15 KB, patch)
2020-10-06 10:40 PDT, Jonathan Bedard
no flags
Radar WebKit Bug Importer
Comment 1 2020-09-11 04:36:56 PDT
Jonathan Bedard
Comment 2 2020-09-30 15:56:30 PDT
Jonathan Bedard
Comment 3 2020-10-01 17:33:49 PDT
Jonathan Bedard
Comment 4 2020-10-01 17:38:29 PDT
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.
Jonathan Bedard
Comment 5 2020-10-02 09:44:24 PDT
This change implements the scheme outlined in https://trac.webkit.org/wiki/commit-identifiers.
dewei_zhu
Comment 6 2020-10-05 16:14:41 PDT
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': []}
Jonathan Bedard
Comment 7 2020-10-05 16:18:11 PDT
Jonathan Bedard
Comment 8 2020-10-05 16:28:37 PDT
Jonathan Bedard
Comment 9 2020-10-06 10:40:15 PDT
Jonathan Bedard
Comment 10 2020-10-06 11:42:58 PDT
(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.
dewei_zhu
Comment 11 2020-10-06 14:51:59 PDT
r=me. For the issue that arguments pass to Memoize can not be a list, there will be a separate change to address that.
Jonathan Bedard
Comment 12 2020-10-06 15:28:36 PDT
(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
EWS
Comment 13 2020-10-06 15:47:25 PDT
Committed r268080: <https://trac.webkit.org/changeset/268080> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410657 [details].
Note You need to log in before you can comment on or make changes to this bug.