[Commented On] D10983: dirstate-item: also build DistateItem in dirstate.directories()

SimonSapin phabricator at mercurial-scm.org
Tue Jul 6 15:18:48 UTC 2021


SimonSapin added a comment.
SimonSapin accepted this revision.


  Alright, we’re not gonna decide right now the future internals of `dirstateitem` so let’s take this patch and we can always change things again later. We’ll probably need to separate the two users of this iterator anyway:
  
  - Now that tree-based `hasdir` is based on "the counter of descendants with an entry is zero" instead of just "this node does not have an entry", `foldmap` should be changed in a same way
  - `debugdirstate` wants all nodes with the maximum of information. That could be a single iterator instead of having it combine values from two iterators.

INLINE COMMENTS

> dirstate.rs:79
> +pub fn make_directory_item(py: Python, mtime: i32) -> PyResult<PyObject> {
> +    // might be silly to retrieve capsule function in hot loop
> +    let make = make_dirstate_item_capi::retrieve(py)?;

https://dgrunwald.github.io/rust-cpython/doc/cpython/macro.py_capsule.html says "with a layer of caching" so it should be fine.

REPOSITORY
  rHG Mercurial

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

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

To: marmoute, #hg-reviewers, SimonSapin
Cc: SimonSapin, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210706/1ec32cfc/attachment-0002.html>


More information about the Mercurial-patches mailing list