D7118: rust-dirstatemap: remove additional lookups in traverse

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Dec 12 11:46:29 EST 2019


martinvonz added a comment.


  In D7118#111784 <https://phab.mercurial-scm.org/D7118#111784>, @Alphare wrote:
  
  > In D7118#111735 <https://phab.mercurial-scm.org/D7118#111735>, @martinvonz wrote:
  >
  >> What's the state of this patch? The description makes it sound like it's a Rust patch, but it only modifies Python code.
  >
  > It only impacts the rust module policy, I figured the name was not a bad idea. Maybe I'm wrong?
  > I also did not find Yuya's suggestion to work, but I may have understood it wrong.
  
  I think Yuya's suggestion was to make the diff be this:
  
    diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
    --- a/mercurial/dirstate.py
    +++ b/mercurial/dirstate.py
    @@ -909,7 +909,7 @@ class dirstate(object):
             matchfn = match.matchfn
             matchalways = match.always()
             matchtdir = match.traversedir
    -        dmap = self._map
    +        dmap = self._map._map
             listdir = util.listdir
             lstat = os.lstat
             dirkind = stat.S_IFDIR
  
  Obviously, you'd need to make some adjustments to allow that, at least renaming `_rustmap` to `_map`. The commit message should also change then.
  
  I don't remember what the point of the nested `_map`s was (perhaps to make it possible to replace the inner `_map`?). Hopefully we're not breaking that by directly accessing the inner `_map`.

REPOSITORY
  rHG Mercurial

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

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

To: Alphare, #hg-reviewers
Cc: martinvonz, yuja, mercurial-devel


More information about the Mercurial-devel mailing list