Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Oct 2021 18:54:40 +0200] rev 48126
dirstatemap: add a common `_refresh_entry` method for dirstatemap
This method is called once a DirstateItem have been modified to apply the
change on the dirstatemap if necessary.
Each variant have a different implementation (which is … the point).
We use `addfile` for the rustmap and not `set_dirstate_item` because we need to
keep the internal counter up to date and `set_dirstate_item` does not do it.
Differential Revision: https://phab.mercurial-scm.org/D11571
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Oct 2021 18:52:26 +0200] rev 48125
dirstatemap: create `_dirs_incr/_dirs_decr` methods on the common class
The Rust wrapper does not need them. However having a default, no-op,
implementation will help use to write code used by both implementation.
Differential Revision: https://phab.mercurial-scm.org/D11570
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Oct 2021 18:49:21 +0200] rev 48124
dirstatemap: small rework of the `set_untracked` method
This shuffle the code a bit to have it flowing more "naturally". This will help
us to create a common version of this code in the next changesets.
Differential Revision: https://phab.mercurial-scm.org/D11569
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 02 Oct 2021 12:10:46 +0200] rev 48123
dirstatemap: arrange methods by category
The dirstatemap code cover various aspects, it grow a bit messy over the years. So we shuffle the code around into some documented categories.
This will help use to clean up the code.
No code was changed in this changeset, only code move.
Differential Revision: https://phab.mercurial-scm.org/D11568
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 02 Oct 2021 12:01:50 +0200] rev 48122
dirstatemap: move a multiple simple functions in the common class
These are small and simple, lets factor them out.
Differential Revision: https://phab.mercurial-scm.org/D11567
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Oct 2021 17:10:24 +0200] rev 48121
dirstatemap: rename `_rustmap` to `_map`
This match the name of the `map` for the other implementation and will make it
simpler to share code between the two.
Differential Revision: https://phab.mercurial-scm.org/D11566
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Oct 2021 16:52:44 +0200] rev 48120
dirstatemap: use a common __init__ for dirstatemap
This is the first and simplest things to put in common.
Differential Revision: https://phab.mercurial-scm.org/D11565
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Oct 2021 16:14:29 +0200] rev 48119
dirstatemap: introduce a common base for the dirstatemap class
We have two dirstatemaps class. One for the python version of the dirstate map
and one for the Rust version (that has a python wrapper to deal with some
aspect of it). We end up with duplicated code between them, so we introduce a
common base class to start migrating common code in them.
Differential Revision: https://phab.mercurial-scm.org/D11564