D7483: changectx: add a "maybe filtered" filtered attribute

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Nov 23 11:21:29 EST 2019


martinvonz added inline comments.

INLINE COMMENTS

> context.py:484
>          self._node = node
> +        self._maybe_filtered = maybe_filtered
>  

Add a comment explaining what this attribute means, such as "indicates that this changeset is visible regardless of filtering". Actually, maybe it's better to name the property something like `filter_agnostic`?

> indygreg wrote in context.py:503
> Before I accept more of this series, I'd like others to think about the potential alternative solution of passing in or storing a reference to the changelog on `basectx`/`changectx`. The reason is that a lot of methods are calling `repo.changelog` and this can be expensive. I suspect we'd get a handful of random performance wins if we cached the changelog instance on each `basectx`. We also wouldn't need to litter the code with a bunch of conditional `repo.unfiltered()` calls since we'd already have an appropriate changelog instance stored in the instance.
> 
> Thoughts?

That would make `ctx.children()` incorrect, right?

I still wonder if the "visible" filter should be removed and (so there would be no `--hidden`, and no annoying message telling you use that flag). We would need to figure out what e.g. `hg log -r 'head()'` and `hg log -r x::` should do (to not include extinct heads) and how to make it easy for the user to get either behavior. Perhaps we would let `head()` be the visible heads and add a new `allheads()` to get all? That's obviously a much larger discussion and maybe a topic for the next sprint instead.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7483/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7483

To: marmoute, #hg-reviewers
Cc: martinvonz, indygreg, mercurial-devel


More information about the Mercurial-devel mailing list