Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 16 Sep 2021 15:21:22 +0200] rev 48026
dirstate: use `reset_state` instead of `dropfile` in test-rebuildstate.t
As `dirstatemap.dropfile` is on its way out.
Differential Revision: https://phab.mercurial-scm.org/D11442
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 16 Sep 2021 15:20:28 +0200] rev 48025
dirstate: use `reset_state` instead of `dropfile` in largefile
As `dirstatemap.dropfile` is on its way out.
Differential Revision: https://phab.mercurial-scm.org/D11441
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:40:25 +0200] rev 48024
dirstate: use `reset_state` in `rebuild` instead of `dropfile`
As `dirstatemap.dropfile` is on its way out.
Differential Revision: https://phab.mercurial-scm.org/D11440
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:38:24 +0200] rev 48023
dirstate: use `reset_state` to drop file in `update_file_p1`
The `dropfile` function is on its way out.
Differential Revision: https://phab.mercurial-scm.org/D11439
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:36:59 +0200] rev 48022
dirstate: support file tracked nowhere in `reset_state`
This let the dirstatemap decide when to drop files.
Differential Revision: https://phab.mercurial-scm.org/D11438
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:30:06 +0200] rev 48021
dirstate: drop dirstatemap.addfile
All users have been migrated.
Differential Revision: https://phab.mercurial-scm.org/D11437
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:27:57 +0200] rev 48020
dirstate: update the documentation of the dirstatemap API
The API changed so should the documentation.
Differential Revision: https://phab.mercurial-scm.org/D11436
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 12:38:56 +0200] rev 48019
dirstate: drop the `_addpath` method
All user have been migrated.
Differential Revision: https://phab.mercurial-scm.org/D11435
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 12:33:59 +0200] rev 48018
dirstate: remove the `normallookup` function
All use have been migrated.
Differential Revision: https://phab.mercurial-scm.org/D11434
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 16 Sep 2021 14:14:33 +0200] rev 48017
dirstate: stop using `_normallookup` in the adddrop extension
That extension is just trying to produce a "corrupted" dirstate.
Differential Revision: https://phab.mercurial-scm.org/D11433
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:12:55 +0200] rev 48016
dirstate: replace the use of `_normallookup` in `rebuild`
Normal lookup is a complicated function that we want to get rid of.
Differential Revision: https://phab.mercurial-scm.org/D11432
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:16:16 +0200] rev 48015
dirstate: replace the use of _normallookup in `setparents`
normal lookup is a complicated function that we want to get rid of.
Differential Revision: https://phab.mercurial-scm.org/D11431
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:05:39 +0200] rev 48014
dirstate: introduce a set_tracked method on "map" and "item"
This move more implementation details withing the DirstateItem itself, which is
what we have been doing for a while.
Differential Revision: https://phab.mercurial-scm.org/D11430
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 11:13:46 +0200] rev 48013
dirstate: fix restoration of "merged" state after a remove
Before this change, "merged" file that get removed and re-added later were
recorded as "from_p2" instead.
This came from 8fe74328f700, a 2014 changeset that start explicitly doing so
for reason I have not been able to fully grasp. The graft test mentioned in
the description are still happy after this changeset.
So this changeset restore what seems to be the intended behavior. Restoring
information as it was before the removal.
Differential Revision: https://phab.mercurial-scm.org/D11429
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 10:20:25 +0200] rev 48012
dirstate: inline the last two `_drop` usage
The function is small and having the associated code directly inline help use to cleanup the dirstate API.
Differential Revision: https://phab.mercurial-scm.org/D11428
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 10:02:11 +0200] rev 48011
dirstate: make a conditionnal easier to read in `setparents`
By grabing `nullid` in the local space, we get the conditionnal to fit in one
line.
Differential Revision: https://phab.mercurial-scm.org/D11427
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 09:50:44 +0200] rev 48010
dirstate: removed the now unused `_add` method
Differential Revision: https://phab.mercurial-scm.org/D11426
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 18:18:16 +0200] rev 48009
dirstate: replace `_add` call in `setparent`
Same logic as the previous changeset, it get us closer to removed older API on
the dirstate.
Differential Revision: https://phab.mercurial-scm.org/D11425
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 09:41:02 +0200] rev 48008
dirstate: directly call the right function in `set_tracked`
This get use closer to removing some older API on the dirstate.
Differential Revision: https://phab.mercurial-scm.org/D11424
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 10:05:25 +0200] rev 48007
dirstate: same logic as what we did for `_drop`
This is part of the dirstatemap so let the dirstatemap deal with it.
Differential Revision: https://phab.mercurial-scm.org/D11423
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Sep 2021 09:28:17 +0200] rev 48006
dirstate: use `tracked` property in `_addpath`
It is semantically better.
Differential Revision: https://phab.mercurial-scm.org/D11422
Simon Sapin <simon.sapin@octobus.net> [Fri, 17 Sep 2021 08:57:12 +0200] rev 48005
rust: Update the memmap2 crate to version 0.4.0
This version:
* Optionally implements the `StableDeref` trait, removing the need
for a wrapper type doing that
* Adds support for mapping empty files, which can routinely happen
for dirstate-v2 data files. This was a cause of some failing tests
when running with `run-tests.py --rhg --extra-config-opt rhg.status=1`
Differential Revision: https://phab.mercurial-scm.org/D11446
Martin von Zweigbergk <martinvonz@google.com> [Thu, 16 Sep 2021 16:42:16 -0700] rev 48004
dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()`
Since https://phab.mercurial-scm.org/D11387 (i.e. the same patch as
mentioned in my previous patch), Clang has also started warning about
`dirstate_item_set_possibly_dirty()` missing an explicit return, and
about its use of the result of an assignment as a condition without
using parentheses. This patch fixes that.
Differential Revision: https://phab.mercurial-scm.org/D11445
Martin von Zweigbergk <martinvonz@google.com> [Thu, 16 Sep 2021 16:29:55 -0700] rev 48003
dirstate: make dirstate flags char be unsigned
Since https://phab.mercurial-scm.org/D11387, `CC='clang -Werror' make
local` has started failing like this:
```
mercurial/cext/util.h:41:50: error: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
static const char dirstate_flag_rust_special = 1 << 7;
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~^~~~
```
This patch fixes that by making the flags be an unsigned char. That
also matches the `bool` typedef we have in `util.h`, which seems good
since many of the `dirstate_item_c_*()` functions return a `bool`.
Differential Revision: https://phab.mercurial-scm.org/D11444
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 03:59:35 +0200] rev 48002
dirstate: introduce a `set_clean` method on dirstate's map and items
This method is the "reverse" of "set possibly dirty", and can be used to more
accurately other call that the dirstate was making. It is currently heavily
influenced by its origin.
Differential Revision: https://phab.mercurial-scm.org/D11421
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 04:03:20 +0200] rev 48001
dirstate: extract the logic to check file/dirname collision when adding a file
Differential Revision: https://phab.mercurial-scm.org/D11420
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 02:53:47 +0200] rev 48000
dirstate: make dirstatemap.set_untracked deal with added file
This merge dropfile in set_untracked.
Differential Revision: https://phab.mercurial-scm.org/D11419
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 02:48:56 +0200] rev 47999
dirstate: remove some usage of `_drop`
This is a step toward being able to remove the `_drop` method on `dirstate`.
Differential Revision: https://phab.mercurial-scm.org/D11418
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Sep 2021 02:44:12 +0200] rev 47998
dirstate: move the copymap drop inside dropfile
Since the copymap is part of the dirstatemap it make more sense for the
dirstatemap to manage it directly.
This is part of a generic effort to move unified logic at lower level and to
clean up higher level API.
Differential Revision: https://phab.mercurial-scm.org/D11417
Simon Sapin <simon.sapin@octobus.net> [Tue, 14 Sep 2021 18:25:51 +0200] rev 47997
rust: Rename get_node methods to data_for_node, get_rev to data_for_rev
These are respective methods of Changelog, Manifestlog, and Filelog;
three Rust structs that that wrap a Revlog struct.
This rename clarifies that node IDs or revision numbers are parameters,
not return values.
Also reword doc-comments in Manifestlog and Filelog to separate node IDs
and revision numbers that are local to a given (non-changelog) revlog
from those of a changeset.
Differential Revision: https://phab.mercurial-scm.org/D11416