This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb0790bebfcf8: revset: move weight information to predicate
(authored by quark, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D657?vs=1896=1919
yuja accepted this revision.
yuja added a comment.
Queued, thanks.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D657
To: quark, #hg-reviewers, phillco, krbullock, singhsrb, yuja
Cc: krbullock, yuja, phillco, mercurial-devel
quark updated this revision to Diff 1896.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D657?vs=1895=1896
REVISION DETAIL
https://phab.mercurial-scm.org/D657
AFFECTED FILES
mercurial/registrar.py
mercurial/revset.py
mercurial/revsetlang.py
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.
(copied from the email thread, though I'm okay with the latest patch.)
On Fri, 8 Sep 2017 18:24:44 +, phillco (Phil Cohen) wrote:
> phillco added a comment.
>
>
quark updated this revision to Diff 1883.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D657?vs=1882=1883
REVISION DETAIL
https://phab.mercurial-scm.org/D657
AFFECTED FILES
mercurial/registrar.py
mercurial/revset.py
mercurial/revsetlang.py
quark updated this revision to Diff 1882.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D657?vs=1666=1882
REVISION DETAIL
https://phab.mercurial-scm.org/D657
AFFECTED FILES
mercurial/registrar.py
mercurial/revset.py
mercurial/revsetlang.py
quark added a comment.
I think it's hard to use constants since that would implicitly limit the
possibilities. Time complexity choices are unbounded in theory. So I'll go the
documentation approach.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D657
To:
krbullock requested changes to this revision.
krbullock added a comment.
This revision now requires changes to proceed.
I think either expanding the docs or using constants would be fine, but the
default weight looks like it's 1, not 10.
REPOSITORY
rHG Mercurial
REVISION DETAIL
On Fri, 8 Sep 2017 18:24:44 +, phillco (Phil Cohen) wrote:
> phillco added a comment.
>
> Constants could pobably help make it more self-documenting.
Perhaps. And maybe we can add a debug command that shows a list of revset
functions sorted by weight.
phillco added a comment.
Constants could pobably help make it more self-documenting.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D657
To: quark, #hg-reviewers, phillco
Cc: yuja, phillco, mercurial-devel
___
quark added a comment.
How about trying to document it? ex.
'weight' is an estimated number for static optimization so things like
"given
'x & y', calculate x first or y first?" could be decided. 'weight' has a
default value 10. revset with O(changelog.d) complexity usually
yuja added a comment.
Perhaps we'll need to make these magic numbers less obfuscated. Before,
weights
were defined in one location and functions were grouped, so it wasn't hard to
guess
what sort of functions should belonged to e.g. the w=30 group. With this
patch,
weights can be
quark added inline comments.
INLINE COMMENTS
> phillco wrote in revset.py:256
> I take it this dictionary was moved there because of the import direction?
Yes.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D657
To: quark, #hg-reviewers, phillco
Cc: phillco,
phillco accepted this revision.
phillco added a comment.
lgtm
INLINE COMMENTS
> revset.py:256
> # x - argument in tree form
> -symbols = {}
> +symbols = revsetlang.symbols
>
I take it this dictionary was moved there because of the import direction?
REPOSITORY
rHG Mercurial
REVISION
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Previously revset weight is hardcoded and cannot be modified. This patch
moves it to predicate so newly registered revsets could define their weight
to properly
15 matches
Mail list logo