Skip to content
Snippets Groups Projects
Commit 28dfb2df4ab9 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

commit: use `dirstate.change_files` to scope the associated `addremove`

This was significantly more complicated than I expected, because multiple
extensions get in the way.

I introduced a context that lazily open the transaction and associated context
to work around these complication. See the inline documentation for details.

Introducing the wrapping transaction remove the need for dirstate-guard (one of
the ultimate goal of all this), and slightly affect the result of a `hg
rollback` after a `hg commit --addremove`. That last part is deemed fine. It
aligns the behavior with what happens after a failed `hg commit --addremove` and
nobody should be using `hg rollback` anyway.

The small output change in the test come from the different transaction timing
and fact the transaction now backup the dirstate before the addremove, which
might mean "no file to backup" when the repository starts from an empty state.
parent a46dfc2b58a3
No related branches found
No related tags found
5 merge requests!485branching: merge default into stable,!435dirstate-scoping [11] : remove dirstate-guard,!434dirstate-scoping [10] : start warning/breaking on bad usage,!433dirstate-scoping [09] : use `changing_files` context in many places,!432dirstate-scoping [08] : use change_files and transaction in the commit logic (sometimes)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment