Tue, 14 Feb 2023 00:31:41 +0100 dirstate-guard: remove usage in `rebase`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Feb 2023 00:31:41 +0100] rev 50062
dirstate-guard: remove usage in `rebase` Now that the dirstate change and write are clearer, it does not seems we need to use a dirstate-guard here anymore. The transaction already wrap the full operation.
Tue, 14 Feb 2023 00:31:23 +0100 dirstate-guard: remove it usage in `mq`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 14 Feb 2023 00:31:23 +0100] rev 50061
dirstate-guard: remove it usage in `mq` The code it covered is also covered by a `changing_parents` context.
Thu, 26 Jan 2023 17:46:54 +0100 dirstate: enforce the use of `changing_files` context to change tracking
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Jan 2023 17:46:54 +0100] rev 50060
dirstate: enforce the use of `changing_files` context to change tracking Now that everything is using the new context, we can start enforcing its usage.
Tue, 13 Dec 2022 03:55:14 +0100 dirstate: warn if we write to the dirstate without holding the wlock
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 03:55:14 +0100] rev 50059
dirstate: warn if we write to the dirstate without holding the wlock Writing the dirstate without holding the wlock can race with other update and overwrite important change. The comment questionning the current state of things was right, we should the `wlock` should always cover the dirstate. (Yes, this is me, agreeing with myself, half a decade later).
Wed, 15 Feb 2023 21:31:37 +0100 dirstate: avoid transaction backup/restore if we do not hold the lock
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 21:31:37 +0100] rev 50058
dirstate: avoid transaction backup/restore if we do not hold the lock Doing overwriting the dirstate content without holding the lock is a recipe for disaster.
Tue, 13 Dec 2022 09:59:22 +0100 dirstate: issue a developer warning on implicit write on wlock release
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 09:59:22 +0100] rev 50057
dirstate: issue a developer warning on implicit write on wlock release Our goal is to get rid of all these to clarify the writing pattern, so it is time to warn about this (and later, forbid it).
Wed, 15 Feb 2023 23:29:04 +0100 status: fix post status invalidation
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 23:29:04 +0100] rev 50056
status: fix post status invalidation If the dirstate changed under us, we should throw away what we have a reload it, should we not ?
Wed, 15 Feb 2023 23:28:20 +0100 status: fix post status writing
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 23:28:20 +0100] rev 50055
status: fix post status writing With dirstate-v2, the status process itself might update internal states. So we make sure this get written on disk
Thu, 15 Dec 2022 02:54:06 +0100 dirstate: use `dirstate.change_files` to scope the change in `shelve`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Dec 2022 02:54:06 +0100] rev 50054
dirstate: use `dirstate.change_files` to scope the change in `shelve` This is the way.
Thu, 15 Dec 2022 03:04:58 +0100 dirstate: use `dirstate.change_files` to scope the change in `unshelve`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Dec 2022 03:04:58 +0100] rev 50053
dirstate: use `dirstate.change_files` to scope the change in `unshelve` This is the way.
Thu, 15 Dec 2022 06:22:23 +0100 shelve: adjust what happens in some `changing_parents` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Dec 2022 06:22:23 +0100] rev 50052
shelve: adjust what happens in some `changing_parents` context It seems like the rest is more about changing tracked_files, so we let start with moving them out of the `changing_parents` contexts.
Mon, 13 Feb 2023 23:29:30 +0100 dirstate: use `dirstate.change_files` to scope the change in `lfconvert`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 13 Feb 2023 23:29:30 +0100] rev 50051
dirstate: use `dirstate.change_files` to scope the change in `lfconvert` This is the way.
Sun, 05 Feb 2023 12:09:52 +0100 largefiles: rely on main scoping for writing dirstate in `markcommitted`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 12:09:52 +0100] rev 50050
largefiles: rely on main scoping for writing dirstate in `markcommitted` Yeah, cleaner code.
Sun, 05 Feb 2023 12:05:23 +0100 largefiles: rely on main scoping for writing dirstate in `mergeupdate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 12:05:23 +0100] rev 50049
largefiles: rely on main scoping for writing dirstate in `mergeupdate` Yeah, cleaner code.
Sat, 04 Feb 2023 16:54:46 +0100 largefiles: rely on the higher level `changing_giles` in `mergerecordupdates`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 04 Feb 2023 16:54:46 +0100] rev 50048
largefiles: rely on the higher level `changing_giles` in `mergerecordupdates` Now that context open on the main dirstate also affect the underlying one, we can skip opening our own in `mergerecordupdates`
Wed, 14 Dec 2022 00:46:58 +0100 dirstate: use wlock and `dirstate.change_files` to scope the change in `mq`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Dec 2022 00:46:58 +0100] rev 50047
dirstate: use wlock and `dirstate.change_files` to scope the change in `mq` This is the way.
Wed, 25 Jan 2023 12:51:26 +0100 subrepo: use `changing_files` context in subrepository code
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 12:51:26 +0100] rev 50046
subrepo: use `changing_files` context in subrepository code This is better, not ideal, but better.
Sat, 04 Feb 2023 12:14:19 +0100 subrepo: let black expand some call on multiple lines early
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 04 Feb 2023 12:14:19 +0100] rev 50045
subrepo: let black expand some call on multiple lines early newer version of black are righfully doing this, so I apply it before more semantic change to reduce noise in the next changeset.
Wed, 14 Dec 2022 00:43:24 +0100 dirstate: use `dirstate.change_files` to scope the change in `import`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Dec 2022 00:43:24 +0100] rev 50044
dirstate: use `dirstate.change_files` to scope the change in `import` This is the way.
Wed, 14 Dec 2022 00:52:06 +0100 dirstate: use `dirstate.change_files` to scope the change in `automv`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Dec 2022 00:52:06 +0100] rev 50043
dirstate: use `dirstate.change_files` to scope the change in `automv` This is... mostly... the way.
Wed, 14 Dec 2022 00:47:22 +0100 dirstate: use `dirstate.change_files` to scope the change in `amend`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Dec 2022 00:47:22 +0100] rev 50042
dirstate: use `dirstate.change_files` to scope the change in `amend` This is the way.
Wed, 25 Jan 2023 12:46:46 +0100 dirstate: use the `changing_files` context in the `keyword` demo
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 12:46:46 +0100] rev 50041
dirstate: use the `changing_files` context in the `keyword` demo This is the way.
Wed, 25 Jan 2023 12:56:26 +0100 dirstate: wrap repository change in appropriate context in `test-context`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 12:56:26 +0100] rev 50040
dirstate: wrap repository change in appropriate context in `test-context` We need the `wlock` (to add files), the `lock` (to commit), a `transaction` (to commit) and a `changing_files` context (to add files). Strictly speaking, we could let the commit take the `lock` and create a `transaction`, but it seems more consistent that way.
Wed, 25 Jan 2023 12:57:52 +0100 dirstate: use wlock and changing_files context in `test-revlog-ancestry`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 12:57:52 +0100] rev 50039
dirstate: use wlock and changing_files context in `test-revlog-ancestry` This is the way.
Tue, 13 Dec 2022 15:01:59 +0100 dirstate: use `dirstate.change_files` to scope the change in `revert`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 15:01:59 +0100] rev 50038
dirstate: use `dirstate.change_files` to scope the change in `revert` This is the way.
Wed, 25 Jan 2023 12:46:22 +0100 dirstate: use `dirstate.change_files` to scope the change in `gpg`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 12:46:22 +0100] rev 50037
dirstate: use `dirstate.change_files` to scope the change in `gpg` This is the way.
Tue, 13 Dec 2022 16:57:41 +0100 dirstate: use `dirstate.change_files` to scope the change in `tag`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 16:57:41 +0100] rev 50036
dirstate: use `dirstate.change_files` to scope the change in `tag` This is the way.
Tue, 31 Jan 2023 00:05:12 +0100 dirstate: use `dirstate.change_files` to scope the change in `rename`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 31 Jan 2023 00:05:12 +0100] rev 50035
dirstate: use `dirstate.change_files` to scope the change in `rename` This is the way, unless we are not actually touching the working copy. In such cases we don't need to do something.
Tue, 31 Jan 2023 00:08:53 +0100 dirstate: use `dirstate.change_files` to scope the change in `copy`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 31 Jan 2023 00:08:53 +0100] rev 50034
dirstate: use `dirstate.change_files` to scope the change in `copy` This is the way, unless we are not actually touching the working copy. In such cases we don't need to do something.
Tue, 13 Dec 2022 16:29:30 +0100 dirstate: use `dirstate.change_files` to scope the change in `remove`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 16:29:30 +0100] rev 50033
dirstate: use `dirstate.change_files` to scope the change in `remove` This is the way.
Tue, 13 Dec 2022 16:27:57 +0100 dirstate: use `dirstate.change_files` to scope the change in `forget`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 16:27:57 +0100] rev 50032
dirstate: use `dirstate.change_files` to scope the change in `forget` This is the way.
Tue, 13 Dec 2022 15:07:32 +0100 dirstate: use `dirstate.change_files` to scope the change in `addremove`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 15:07:32 +0100] rev 50031
dirstate: use `dirstate.change_files` to scope the change in `addremove` This is the way.
Tue, 13 Dec 2022 12:57:38 +0100 dirstate: use `dirstate.change_files` to scope the change in `add`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 12:57:38 +0100] rev 50030
dirstate: use `dirstate.change_files` to scope the change in `add` This is the way.
Wed, 15 Feb 2023 11:51:58 +0100 commit: use `dirstate.change_files` to scope the associated `addremove`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 11:51:58 +0100] rev 50029
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.
Sun, 05 Feb 2023 15:38:23 +0100 commit: move the addremove logic around to make the next changeset clearer
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 15:38:23 +0100] rev 50028
commit: move the addremove logic around to make the next changeset clearer Lets do the noise now, without changing any thing. So the new changeset can focus on the actual semantic changes.
Wed, 15 Feb 2023 10:46:46 +0100 largefiles: link the core dirstate._changing context to the lfdirstate one
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 10:46:46 +0100] rev 50027
largefiles: link the core dirstate._changing context to the lfdirstate one This will be much cleaner and safer to make sure the two dirstates are in sync. This way, the large-files dirstate will simply inherit the state of the main dirstate, so if the core code does the right thing, the large-files code should be right too.
Thu, 26 Jan 2023 17:44:27 +0100 dirstate: add a context for tracking files change
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Jan 2023 17:44:27 +0100] rev 50026
dirstate: add a context for tracking files change Let us start to use it. We will enforce it later.
Mon, 13 Feb 2023 21:51:45 +0100 dirstate: invalidate the dirstate change on transaction failure
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 13 Feb 2023 21:51:45 +0100] rev 50025
dirstate: invalidate the dirstate change on transaction failure If the change context lives inside a transaction, the change are not flushed to disk on exit as this is delegated to the transaction. As a result we should also delegate the part that do cleanup on failure. The issue was caught by tests with other change, but it seems useful to fix this as soon as possible.
Thu, 26 Jan 2023 17:16:24 +0100 dirstate: factor the "changing" context logic out
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Jan 2023 17:16:24 +0100] rev 50024
dirstate: factor the "changing" context logic out This makes it reusable for other types of changes.
Thu, 26 Jan 2023 15:50:45 +0100 dirstate: introduce a `is_changing_any` property
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Jan 2023 15:50:45 +0100] rev 50023
dirstate: introduce a `is_changing_any` property This will embrace other cases than changing parents.
Mon, 30 Jan 2023 19:21:34 +0100 dirstate: rename `pendingparentchange` to `is_changing_parents`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 30 Jan 2023 19:21:34 +0100] rev 50022
dirstate: rename `pendingparentchange` to `is_changing_parents` This is clearer and more inline witht he other change we did.
Thu, 26 Jan 2023 15:50:36 +0100 dirstate: rename _parentwriters to _changing_level
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Jan 2023 15:50:36 +0100] rev 50021
dirstate: rename _parentwriters to _changing_level We will have context for changing more than parents, so lets be prepared.
Sun, 05 Feb 2023 12:14:45 +0100 largefiles: remove the `changing_parents` context in `openlfdirstate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 12:14:45 +0100] rev 50020
largefiles: remove the `changing_parents` context in `openlfdirstate` This code might run in any kind of change context, we should rely on the higher level context instead of opening our own.
Wed, 15 Feb 2023 00:57:16 +0100 largefiles: remove the second `changing_parents` in `updatelfiles`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 00:57:16 +0100] rev 50019
largefiles: remove the second `changing_parents` in `updatelfiles` Now that the `update_file` call have been migrated, we can drop the semantically-wrong `changing_parents` context.
Wed, 15 Feb 2023 00:55:44 +0100 largefiles: remove the first `changing_parents` in `updatelfiles`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 00:55:44 +0100] rev 50018
largefiles: remove the first `changing_parents` in `updatelfiles` Now that the `update_file` call have been migrated, we can drop the semantically-wrong `changing_parents` context.
Sun, 05 Feb 2023 09:25:23 +0100 largefiles: use `hacky_extension_update_file` in `updatelfiles`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 09:25:23 +0100] rev 50017
largefiles: use `hacky_extension_update_file` in `updatelfiles` This is what the function is meant for.
Sun, 05 Feb 2023 08:38:43 +0100 largefiles: use `hacky_extension_update_file` in `synclfdirstate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 08:38:43 +0100] rev 50016
largefiles: use `hacky_extension_update_file` in `synclfdirstate` This is what the function is meant for.
Sun, 05 Feb 2023 08:37:33 +0100 largefiles: use `hacky_extension_update_file` in `openlfdirstate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 08:37:33 +0100] rev 50015
largefiles: use `hacky_extension_update_file` in `openlfdirstate` This is what the function is meant for.
Sat, 04 Feb 2023 09:08:26 +0100 win32text: make the hacky call cover more cases
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 04 Feb 2023 09:08:26 +0100] rev 50014
win32text: make the hacky call cover more cases Now that I understand what this is doing, It seems like the case for `p1_tracked` were covered by neither the code nor the test. Now the code cover it at least.
Wed, 25 Jan 2023 12:47:55 +0100 win32text: drop the `changing_parents` context in revert upgrade
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 12:47:55 +0100] rev 50013
win32text: drop the `changing_parents` context in revert upgrade We are not changing parents here, so let us not pretend we do.
Wed, 15 Feb 2023 00:29:39 +0100 win32text: clean up and clarify the post-revert hack of dirstate
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 00:29:39 +0100] rev 50012
win32text: clean up and clarify the post-revert hack of dirstate The change is unrelated to changing parents and should not be a in a "changing_parents" context. This call is quite hacky, but now it is at least explicitly hacky. We will drop the `changing_parents` context in the next changesets, but we kept this change simple to help readability.
Wed, 15 Feb 2023 00:26:08 +0100 dirstate: introduce a `hacky_extension_update_file` method
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Feb 2023 00:26:08 +0100] rev 50011
dirstate: introduce a `hacky_extension_update_file` method See inline documentation for details.
Tue, 07 Feb 2023 09:36:35 +0100 mq: properly take the wlock during the full qfold operation
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Feb 2023 09:36:35 +0100] rev 50010
mq: properly take the wlock during the full qfold operation Otherwise the operation could be raced… for unknown result.
Sat, 04 Feb 2023 11:46:57 +0100 locking: hold the wlock for the full duration of the "keyword demo"
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 04 Feb 2023 11:46:57 +0100] rev 50009
locking: hold the wlock for the full duration of the "keyword demo" The risk of racing the demo is low, since it seems to create its own repository on the fly. However it is clearer and more consistent.
Sun, 05 Feb 2023 16:54:26 +0100 locking: grab the wlock before touching the dirstate in `perfdirstatewrite`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 05 Feb 2023 16:54:26 +0100] rev 50008
locking: grab the wlock before touching the dirstate in `perfdirstatewrite` If we touch the dirstate, we should hold the `wlock`.
Tue, 13 Dec 2022 04:22:19 +0100 locking: take the `wlock` for the full `hg addremove` duration
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 04:22:19 +0100] rev 50007
locking: take the `wlock` for the full `hg addremove` duration Otherwise, there is a race condition window between the time we resolve the file to addremove with the matcher and the time we lock the repo and modify the dirstate. For example, the working copy might have been updated away, or purged, and the matched files would no longer be correct.
Tue, 13 Dec 2022 16:26:13 +0100 locking: take the `wlock` for the full `hg forget` duration
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 16:26:13 +0100] rev 50006
locking: take the `wlock` for the full `hg forget` duration Otherwise, there is a race condition window between the time we resolve the file to forget with the matcher and the time we lock the repo and modify the dirstate. For example, the working copy might have been updated away, or purged, and the matched files would no longer be correct.
Tue, 13 Dec 2022 04:22:46 +0100 locking: take the `wlock` for the full `hg remove` duration
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 04:22:46 +0100] rev 50005
locking: take the `wlock` for the full `hg remove` duration Otherwise, there is a race condition window between the time we resolve the file to remove with the matcher and the time we lock the repo and modify the dirstate. For example, the working copy might have been updated away, or purged, and the matched files would no longer be correct.
Tue, 13 Dec 2022 04:21:27 +0100 locking: take the `wlock` for the full `hg add` duration
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 04:21:27 +0100] rev 50004
locking: take the `wlock` for the full `hg add` duration Otherwise, there is a race condition window between the time we resolve the file to add with the matcher and the time we lock the repo and modify the dirstate. For example, the working copy might have been updated away, or purged, and the matched files would no longer be correct.
Mon, 06 Feb 2023 01:22:01 +0100 dirstate: drop some very fishy looking piece of code
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Feb 2023 01:22:01 +0100] rev 50003
dirstate: drop some very fishy looking piece of code This piece of code is marking the **real** dirstate file as a temporary transaction file. This means it get deleted on transaction rollback. This this quite wrong, especially as the comment points out some `dirstate.pending` motivation and the `.pending` file should already be fully managed by the transaction. The only ready I can think of this behavior not having awful results right now is because other transaction logic restore backed up content above the one that got wrongfully deleted. Let us stop doing this anyway, All tests seems happy.
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 tip