Thu, 02 Mar 2023 14:50:17 +0100 dirstate: use a context manager to handle the file used for writing the branch
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Mar 2023 14:50:17 +0100] rev 50254
dirstate: use a context manager to handle the file used for writing the branch This is more modern.
Thu, 02 Mar 2023 11:54:21 +0100 style: rewrap `ui.deprecwarn` declaration
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Mar 2023 11:54:21 +0100] rev 50253
style: rewrap `ui.deprecwarn` declaration This get easier to read, especially with the type annotation.
Thu, 02 Mar 2023 19:02:52 +0100 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Mar 2023 19:02:52 +0100] rev 50252
branching: merge stable into default The clippy god had to be appeased on some aspect.
Thu, 02 Mar 2023 04:16:47 +0100 narrow: read pending file when applicable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 02 Mar 2023 04:16:47 +0100] rev 50251
narrow: read pending file when applicable Now that this is part of the transaction, this is necessary to make sure we read the right data in hooks (if any).
Tue, 28 Feb 2023 11:44:52 -0500 hghave: drop py27 and py35 support
Matt Harbison <matt_harbison@yahoo.com> [Tue, 28 Feb 2023 11:44:52 -0500] rev 50250
hghave: drop py27 and py35 support These versions of python are no longer supported by Mercurial.
Tue, 28 Feb 2023 11:41:50 -0500 hghave: byteify a path passed to a core API
Matt Harbison <matt_harbison@yahoo.com> [Tue, 28 Feb 2023 11:41:50 -0500] rev 50249
hghave: byteify a path passed to a core API It looks like this predicate isn't used at all(?)
Mon, 27 Feb 2023 18:24:29 +0000 rust: box ConfigValueParseError to avoid large result types
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 27 Feb 2023 18:24:29 +0000] rev 50248
rust: box ConfigValueParseError to avoid large result types clippy emits a warning that all the Result types are way too large because of HgError includes ConfigValueParseError as one of the variants, so its size is 136 bytes. By boxing ConfigValueParseError we're hopefully making everything faster "for free".
Wed, 22 Feb 2023 02:08:11 +0100 dirstate: drop `identity` from the public API
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 02:08:11 +0100] rev 50247
dirstate: drop `identity` from the public API We no longer needs it.
Thu, 23 Feb 2023 15:32:27 +0100 delta-find: rename `delta-reuse-policy` to `pulled-delta-reuse-policy`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 15:32:27 +0100] rev 50246
delta-find: rename `delta-reuse-policy` to `pulled-delta-reuse-policy` This make it clearer which type of delta we are talking about.
Thu, 23 Feb 2023 15:27:42 +0100 config-item: declare undeclared path suboption
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 15:27:42 +0100] rev 50245
config-item: declare undeclared path suboption This should prevent issue like the previous commit.
Thu, 23 Feb 2023 15:26:43 +0100 delta-find: declare the "paths..*:delta-reuse-policy option
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 15:26:43 +0100] rev 50244
delta-find: declare the "paths..*:delta-reuse-policy option While looking into renaming the option I realized it was not declared.
Thu, 23 Feb 2023 15:16:40 +0100 delta-find: adjust the default candidate group chunk size
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 15:16:40 +0100] rev 50243
delta-find: adjust the default candidate group chunk size We move from 10 to 20 as the default as some usage in the wild saw a small degradation in storage quality when using `10`.
Tue, 07 Feb 2023 10:27:21 +0100 record: extract a closure to the module level
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Feb 2023 10:27:21 +0100] rev 50242
record: extract a closure to the module level This clean up is almost as gratuituous as this closure was.
Tue, 07 Feb 2023 10:16:25 +0100 record: drop a now useless overlay that grab the lock
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Feb 2023 10:16:25 +0100] rev 50241
record: drop a now useless overlay that grab the lock Since 28dfb2df4ab9, commit grab the wlock and the extra layer grabing the lock in record is no longer needed. We clean up the code to make this simpler (and add a small assert for extra security against future change).
Fri, 24 Feb 2023 03:03:54 +0100 bundlerepo: fix string interpolation
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 24 Feb 2023 03:03:54 +0100] rev 50240
bundlerepo: fix string interpolation Matt Harbison is saying we cannot `%s` a type into a byte string and that seems reasonable.
Thu, 23 Feb 2023 23:05:51 +0100 bundlerepo: apply phase data stored in the bundle instead of assuming `draft`
Matt Harbison <matt_harbison@yahoo.com>, Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 23:05:51 +0100] rev 50239
bundlerepo: apply phase data stored in the bundle instead of assuming `draft` The phase information contained in the changegroup part and the explicit `phase-heads` part are now taken in account. Initial changes and test by Matt Harbison, code rework by Pierre-Yves David.
Thu, 23 Feb 2023 19:07:58 +0100 bundlerepo: handle changegroup induced phase movement in the associated method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 19:07:58 +0100] rev 50238
bundlerepo: handle changegroup induced phase movement in the associated method These movement comes from handling the changegroup part, so we keeps the code grouped. This will be important when handling more part (and more changegroup part in the future) This induce a small code duplication, but it does not looks terrible.
Thu, 23 Feb 2023 19:06:24 +0100 bundlerepo: move most attribute declaration earlier in __init__
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 19:06:24 +0100] rev 50237
bundlerepo: move most attribute declaration earlier in __init__ The expected attribute are clearer this way. The bundle handling code is responsible for setting most of it.
Thu, 23 Feb 2023 19:04:44 +0100 bundlerepo: move the handling of bundl1 in its own method
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 19:04:44 +0100] rev 50236
bundlerepo: move the handling of bundl1 in its own method This should make the overall flow simpler to follow.
Thu, 23 Feb 2023 19:02:01 +0100 bundlerepo: expliclty handing cg part from bundle2
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 19:02:01 +0100] rev 50235
bundlerepo: expliclty handing cg part from bundle2 We will handle other types of parts soon (phase-heads) so we need some cleanup first.
Thu, 23 Feb 2023 15:37:46 +0100 transaction: use the standard transaction mechanism to backup branch
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 15:37:46 +0100] rev 50234
transaction: use the standard transaction mechanism to backup branch Branch is a bit special : - It currently does not collaborate with the transaction (or any scoping) for writing (this is bad) - It can change without the lock being taken (it is protected by `wlock`) So we rely on the same mechanism as for the backup of the other dirstate file: - we only do a backup if we hold the wlock - we force a backup though the transaction Since "branch" write does not collaborate with the transaction, we cannot back it up "at the last minute" as we do for the dirstate. We have to back it up "upfront". Since we have a backup, the transaction is no longer doing its "quick_abort" and get noisy. Which is quite annoying. To work around this, and to avoid jumping in yet-another-rabbit-hole of "getting branch written properly", I am doing horrible things to the transaction in the meantime. We should be able to get this code go away during the next cycle. In the meantime, I prefer to take this small stop so that we stop abusing the "journal" and "undo" mechanism instead of the proper backup mechanism of the transaction. Also note that this change regress the warning message for the legacy fallback introduced in 2008 when issue902 got fixed in dd5a501cb97f (Mercurial 1.0). I feel like this is fine as issue 902 remains fixed, and this would only affect people deploying a mix of 15 year old Mercurial and modern mercurial, and using branch and rollback extensively.
Thu, 23 Feb 2023 04:53:34 +0100 transaction: no longer explicitly cache bookmarks
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 04:53:34 +0100] rev 50233
transaction: no longer explicitly cache bookmarks The transaction file generation is already dealing with the backup for this. So, no need to duplicate such backup.
Wed, 22 Feb 2023 18:58:02 +0100 transaction: no longer explicitly cache phaseroots
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 18:58:02 +0100] rev 50232
transaction: no longer explicitly cache phaseroots The transaction file generation is already dealing with the backup for this. So, no need to duplicate such backup.
Thu, 23 Feb 2023 04:28:24 +0100 narrow: enforce that narrow spec is written within a transaction
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 04:28:24 +0100] rev 50231
narrow: enforce that narrow spec is written within a transaction
Thu, 23 Feb 2023 04:42:17 +0100 narrow: write the narrow spec in a transaction during share
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 04:42:17 +0100] rev 50230
narrow: write the narrow spec in a transaction during share It will be simpler if all write happens within transaction.
Thu, 23 Feb 2023 04:36:19 +0100 narrow: open the transaction sooner when unbundling
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 04:36:19 +0100] rev 50229
narrow: open the transaction sooner when unbundling That way, the narrow spec changes will be done within a transaction.
Thu, 23 Feb 2023 04:35:16 +0100 narrow: write the narrow spec in a transaction during clone
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 04:35:16 +0100] rev 50228
narrow: write the narrow spec in a transaction during clone It will be simpler if all write happens within transaction.
Thu, 23 Feb 2023 03:28:44 +0100 narrow: drop the dedicated backup code
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 03:28:44 +0100] rev 50227
narrow: drop the dedicated backup code Now that the transaction manage the writes, we can simply use the transaction for backup. Some extra cleanup to ensure all changes happens within a transaction will be made in the next changesets.
Thu, 23 Feb 2023 03:25:44 +0100 narrow: delegate the dirstate's narrow spec writing to the transaction
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 03:25:44 +0100] rev 50226
narrow: delegate the dirstate's narrow spec writing to the transaction This make it more transactional and will help us to simplify their backup. The implementation is not great, but it keep the patch simple as this is not the time for a larger refactoring yet.
Thu, 23 Feb 2023 04:15:16 +0100 narrow: delegate the narrow spec writing to the transaction
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 04:15:16 +0100] rev 50225
narrow: delegate the narrow spec writing to the transaction This make it more transactional and will help us to simplify their backup. The implementation is not great, but it keep the patch simple as this is not the time for a larger refactoring yet.
Thu, 23 Feb 2023 04:02:38 +0100 narrow: get the narrow patterns from the repository object instead of disk
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 04:02:38 +0100] rev 50224
narrow: get the narrow patterns from the repository object instead of disk Relying on disk data make the transactionally of this change complicated, so let us start reading data from other API instead.
Thu, 23 Feb 2023 00:12:53 +0100 narrow: widden the lock context in `tracking`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 00:12:53 +0100] rev 50223
narrow: widden the lock context in `tracking` The tracking configuration we modify must be read under lock. So we grab the lock sooner.
Thu, 23 Feb 2023 03:49:29 +0100 narrow: move `only_show` handling sooner in `tracked`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Feb 2023 03:49:29 +0100] rev 50222
narrow: move `only_show` handling sooner in `tracked` This will help us to improve the locking scope in the `tracked` command.
Fri, 24 Feb 2023 13:23:15 +0000 tests: in test-fncache.t, be more tolerant to the "Killed" message format
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 24 Feb 2023 13:23:15 +0000] rev 50221
tests: in test-fncache.t, be more tolerant to the "Killed" message format For example, on my box I'm seeing: $TESTTMP.sh: line 250: $pid Killed hg ci -qAm z
Thu, 23 Feb 2023 23:25:28 +0100 convert: use a priority queue for sorting commits, to make sorting faster
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 23 Feb 2023 23:25:28 +0100] rev 50220
convert: use a priority queue for sorting commits, to make sorting faster To achieve this, we turn commit sorters into classes so they can encapsulate state. This reduces the sorting time from ~30s to ~10s on a 500k-commit prefix of a repo I tried to convert. (and probably reduces the time to sort the whole repo from many tens of minutes to minutes, but I didn't try that again) The date caching gets removed because priority queue already caches the key.
Tue, 21 Feb 2023 13:26:07 -0500 typing: add the return type hint to pycompat.rangelist()
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Feb 2023 13:26:07 -0500] rev 50219
typing: add the return type hint to pycompat.rangelist() Not bothering with the args, because there are a few overloads and only 2 callers in the codebase, one of which is a test.
Tue, 21 Feb 2023 13:24:12 -0500 typing: add type hints to pycompat.maplist()
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Feb 2023 13:24:12 -0500] rev 50218
typing: add type hints to pycompat.maplist() The typeshed hints define 5 overloads with an increasing number of parameters on the passed function, and then a catchall that ignores the argument list on the passed function and allows an `*iterators` arg. All of our uses are fulfilled by the 1 function + 1 iterable overload, but add the second overload as a hint in case it's needed in the future.
Wed, 22 Feb 2023 18:42:09 +0100 branching: merge stable into default
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 18:42:09 +0100] rev 50217
branching: merge stable into default This show that the recent changes on default fixed the issue with transaction overwriting content in `test-transaction-wc-rollback-race.t`
Fri, 17 Feb 2023 16:48:11 +0000 rhg: in path_encode, simplify a bit more
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 17 Feb 2023 16:48:11 +0000] rev 50216
rhg: in path_encode, simplify a bit more Use the slices for `basename` and `ext` instead of dealing with offsets.
Fri, 17 Feb 2023 13:29:39 +0000 rhg: in path_encode, be a bit more conservative about memory usage
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 17 Feb 2023 13:29:39 +0000] rev 50215
rhg: in path_encode, be a bit more conservative about memory usage Use [shrink_to_fit] to match the previous behavior more closely, and potentially save (a tiny bit) of memory. FWIW, I suspect this is unnecessary, but this whole MR is about simplifying things while preserving any existing optimizations.
Thu, 16 Feb 2023 19:14:51 +0000 rhg: small refactor: stop using a magical constant "+ 1"
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 19:14:51 +0000] rev 50214
rhg: small refactor: stop using a magical constant "+ 1" Instead, directly do what the "+ 1" was supposed to achive: call hash_encode.
Thu, 16 Feb 2023 19:03:17 +0000 rhg: in path_encode, use Vec directly instead of VecDest
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 19:03:17 +0000] rev 50213
rhg: in path_encode, use Vec directly instead of VecDest No need to have a trivial wrapper over the type. There's nothing confusing about vec.write_bytes(...), after all.
Thu, 16 Feb 2023 19:00:56 +0000 rhg: in path_encode, split Dest into VecDest and MeasureDest
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 19:00:56 +0000] rev 50212
rhg: in path_encode, split Dest into VecDest and MeasureDest Two separate types make the write semantics easier to understand because we can consider the two sinks separately. Having two independent compiled functions for size measurement and for actual encoding seems likely to improve performance, too. (and maybe we should get rid of measurement altogether) Getting rid of [Dest] also removes the ugly option rewrapping code, which is good.
Thu, 16 Feb 2023 18:46:44 +0000 rhg: use generic DestArr in hash_mangle
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 18:46:44 +0000] rev 50211
rhg: use generic DestArr in hash_mangle This simplifies code a bit more, but comes with an extra memory copy in case [destlen == dest_vec.len()]. This is probably fine, but a follow-up change is removing that too.
Thu, 16 Feb 2023 18:45:23 +0000 rhg: in path_encode, make DestArr generic over its size
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 18:45:23 +0000] rev 50210
rhg: in path_encode, make DestArr generic over its size
Thu, 16 Feb 2023 18:41:06 +0000 rhg: in path_encode add a DestArr type
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 18:41:06 +0000] rev 50209
rhg: in path_encode add a DestArr type This is an implementation of Sink trait that writes into a fixed-size buffer on the stack, so identical to what was done before, but it makes the code of [hash_encode] easier to understand by dropping all these slice manipulations.
Thu, 16 Feb 2023 18:29:52 +0000 rhg: reduce verbosity in path_encode by using a trait for writing
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 18:29:52 +0000] rev 50208
rhg: reduce verbosity in path_encode by using a trait for writing Hopefully this makes the code easier to read and understand and shorter overall. It also lets us later tweak the type we use as a [Sink], without having to change the encoding functions, including using two different types for size measurement and for the actual serialization.
Thu, 16 Feb 2023 16:20:17 +0000 refactor: simplify code in rust version of path_encode
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 16 Feb 2023 16:20:17 +0000] rev 50207
refactor: simplify code in rust version of path_encode Moving the addition of '/' separator to the end of the loop makes the rest of the logic much simpler because the first iteration is no longer special.
Mon, 20 Feb 2023 23:46:20 +0100 dirstate: phase-divergent update to 4e95341c89aa
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 23:46:20 +0100] rev 50206
dirstate: phase-divergent update to 4e95341c89aa Heptapod published the obsolete version of those.
Tue, 21 Feb 2023 22:25:20 +0100 dirstate: phase-divergent update to 65943224c184
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 22:25:20 +0100] rev 50205
dirstate: phase-divergent update to 65943224c184 Heptapod published the obsolete version of those.
Sun, 19 Feb 2023 03:21:12 +0100 dirstate: phase-divergent update to 3433723d1b9b
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 19 Feb 2023 03:21:12 +0100] rev 50204
dirstate: phase-divergent update to 3433723d1b9b Heptapod published the obsolete version of those.
Wed, 22 Feb 2023 03:42:36 +0100 dirstate: enforce change context for hacky_extension_update_file
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 03:42:36 +0100] rev 50203
dirstate: enforce change context for hacky_extension_update_file This was the last method not scoped yet
Wed, 22 Feb 2023 04:00:30 +0100 large-files: use a `changing_files` context when initializing the dirstate
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 04:00:30 +0100] rev 50202
large-files: use a `changing_files` context when initializing the dirstate We are obviously mutating the dirstate, so lets scope this mutation.
Wed, 22 Feb 2023 03:20:19 +0100 dirstate: enforce context set_clean and set_possibly_dirty
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 03:20:19 +0100] rev 50201
dirstate: enforce context set_clean and set_possibly_dirty We don't want them called within a `changing_parents` context, but we still want them called within a context. So we update the decorator accordingly
Wed, 22 Feb 2023 03:35:18 +0100 keyword: wrap dirstate mutation in `changing_files` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 03:35:18 +0100] rev 50200
keyword: wrap dirstate mutation in `changing_files` context This is the way.
Wed, 22 Feb 2023 03:34:48 +0100 keyword: wrap dirstate mutation in `changing_files` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 03:34:48 +0100] rev 50199
keyword: wrap dirstate mutation in `changing_files` context This is the way.
Tue, 21 Feb 2023 23:10:02 +0100 dirstate: enforce `running_status` context for calling `status`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 23:10:02 +0100] rev 50198
dirstate: enforce `running_status` context for calling `status` Now that the context is working as intended and that the callers are updated. We can enforce it.
Mon, 20 Feb 2023 17:13:29 +0100 dirstate: have `running_status` warn when exiting with a dirty dirstate
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 17:13:29 +0100] rev 50197
dirstate: have `running_status` warn when exiting with a dirty dirstate If running_status was started without the lock, all changes should have been explicitly written (with the lock) or invalidated before exiting the context.
Wed, 22 Feb 2023 02:21:27 +0100 dirstate: have `running_status` write the dirstate when holding the lock
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 02:21:27 +0100] rev 50196
dirstate: have `running_status` write the dirstate when holding the lock This is simple and harmless.
Mon, 20 Feb 2023 16:57:10 +0100 dirstate: check that dirstate is clean at the initial context opening
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 16:57:10 +0100] rev 50195
dirstate: check that dirstate is clean at the initial context opening More checking that we are not doing anything weird.
Tue, 21 Feb 2023 22:32:04 +0100 dirstate: start tracking that we are within a `running_status` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 22:32:04 +0100] rev 50194
dirstate: start tracking that we are within a `running_status` context
Mon, 20 Feb 2023 15:28:08 +0100 dirstate: add documentation about the expectation of `running_status` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 15:28:08 +0100] rev 50193
dirstate: add documentation about the expectation of `running_status` context
Mon, 20 Feb 2023 14:55:16 +0100 contrib-perf: use `running_status` in `perf::status`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 14:55:16 +0100] rev 50192
contrib-perf: use `running_status` in `perf::status` This is the way.
Mon, 20 Feb 2023 17:16:52 +0100 large-files: also open the context in the subdirstate
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 17:16:52 +0100] rev 50191
large-files: also open the context in the subdirstate
Wed, 22 Feb 2023 00:23:06 +0100 large-files: use `running_status` in `mergeupdate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:23:06 +0100] rev 50190
large-files: use `running_status` in `mergeupdate`
Wed, 22 Feb 2023 00:22:44 +0100 large-files: use `running_status` in `scmutiladdremove`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:22:44 +0100] rev 50189
large-files: use `running_status` in `scmutiladdremove` This is the way.
Wed, 22 Feb 2023 00:24:47 +0100 large-files: open the transaction sooner in `scmutiladdremove`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:24:47 +0100] rev 50188
large-files: open the transaction sooner in `scmutiladdremove` We want it to encompass the status call.
Wed, 22 Feb 2023 00:22:16 +0100 large-files: use `running_status` in `overriderevert`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:22:16 +0100] rev 50187
large-files: use `running_status` in `overriderevert` This is the way
Wed, 22 Feb 2023 00:21:57 +0100 large-files: use `running_status` in `updatestandinsbymatch`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:21:57 +0100] rev 50186
large-files: use `running_status` in `updatestandinsbymatch` This is the way.
Wed, 22 Feb 2023 00:19:00 +0100 large-files: wrap reposetup's status in a `running_status` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:19:00 +0100] rev 50185
large-files: wrap reposetup's status in a `running_status` context This is the way.
Wed, 22 Feb 2023 00:41:27 +0100 narrow: use `running_status` in `updateworkingcopy`
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:41:27 +0100] rev 50184
narrow: use `running_status` in `updateworkingcopy` This is the way.
Mon, 20 Feb 2023 17:26:41 +0100 status: use `running_status` in dirstate status
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 17:26:41 +0100] rev 50183
status: use `running_status` in dirstate status This is the way.
Mon, 20 Feb 2023 17:22:57 +0100 status: pre-indent the dirstate status code
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 17:22:57 +0100] rev 50182
status: pre-indent the dirstate status code This make the next changeset clearer.
Mon, 20 Feb 2023 15:18:07 +0100 dirstate: introduce a (noop) running_status context
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 15:18:07 +0100] rev 50181
dirstate: introduce a (noop) running_status context Let us start with a simplistic context so we can scope the appropriate code before adding more logic.
Tue, 21 Feb 2023 22:14:12 +0100 status: invalidate dirstate on LockError
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 22:14:12 +0100] rev 50180
status: invalidate dirstate on LockError If we cannot take the lock, someone else is modifying the repository. Let us discard dirstate uncommitted data before exiting the status code. Having a clean dirstate after such operation seems safer. Strictly speaking, there is a small behavior change in the following situation: * process A call `status` outside of the `wlock` * process B grab the `wlock` * process A fails to acquires the lock to write status fixup * process B release the `wlock` *without touching the dirstate* * process A later grab the `wlock` * process A can write dirstate update from earlier `status` However this is a fairly hypothetical situation : * process A has to be raced * process B have to not update the dirstate * process A has to run another *unrelated* operation later. This seems rare enough to overlook. I am stating that the two operations in process A has to be unrelated. Otherwise, collecting status data outside of the lock to use them inside the lock is racy. Any other process could move things around (eg: the working copy) making the data collected during status irrelevantor even harmful. If such code exists, it should be fixed ASAP.
Tue, 21 Feb 2023 16:20:11 +0100 status: simplify the post status fixup phases
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 16:20:11 +0100] rev 50179
status: simplify the post status fixup phases With the wlock automatically discarding changes when applicable, we can simplify the code a bit. * we perform the fixup operation before trying to grab the lock to narrow the `try/except` * we no longer need to explicitly complare dirstate identities. We can trust the dirstate internal refresh for that. It would invalidate dirty data when needed. * detect still data invalidation by checking the dirty flag before and after taking the lock. Doing this is actually only necessary to issue the debug message, we could blindy trust the dirstate internal to ignore the `write` call on a non-dirty dirstate.
Tue, 21 Feb 2023 15:35:31 +0100 dirstate: cleanup the `_map` property cache
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 15:35:31 +0100] rev 50178
dirstate: cleanup the `_map` property cache The removed code was duplicating the effect of `@propertycache`. This is a gratuitous cleanup.
Wed, 22 Feb 2023 01:08:25 +0100 dirstate: only reload the dirstate when it may have changed
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 01:08:25 +0100] rev 50177
dirstate: only reload the dirstate when it may have changed This reinstall the equivalent of what the `filecache` was doing. However it does it at the dirstate level. There is a double motivation for this: - This avoid duplicating logic with the dirstate "identity" logic. - This increase the lifetime of the `dirstate` object, helping to implement change scoping.
Wed, 22 Feb 2023 01:04:55 +0100 dirstate: directly manage the dirstate property on localrepo
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 01:04:55 +0100] rev 50176
dirstate: directly manage the dirstate property on localrepo Before we had: * the filecache layer on `localrepo` doing some caching * the dirstate having some internal invalidation/refresh machanism * the status code doing some identity validation. To clean this up, we are dropping the first item "localrepo `filecache`" from the equation in a favor of an approach integrated into the dirstate (second item) in the next changesets. This changeset will be a small windows where some things will be a bit slower. This will be fixed in the next changesets.
Tue, 21 Feb 2023 15:10:12 +0100 dirstate: factor the identity getting/setting code in the dirstate map
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 15:10:12 +0100] rev 50175
dirstate: factor the identity getting/setting code in the dirstate map We are doing the same things twice and we will add more logic in the next changesets. So lets start factoring things out now.
Wed, 22 Feb 2023 00:53:51 +0100 dirstate: use `cachestat` object for dirstatemap identity
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 22 Feb 2023 00:53:51 +0100] rev 50174
dirstate: use `cachestat` object for dirstatemap identity There is a class dedicated to this kind of cache check, let us use it. We will generalize this code in the next changesets, but we do the "behavior changing" pass on our own.
Tue, 21 Feb 2023 22:17:33 +0100 automv: lock the repository before searching for renames
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 22:17:33 +0100] rev 50173
automv: lock the repository before searching for renames I detected this while debugging something else.
Mon, 20 Feb 2023 23:46:20 +0100 dirstate: distinct transaction callback from largefile
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 23:46:20 +0100] rev 50172
dirstate: distinct transaction callback from largefile This has not caused any issue so far because the large-files dirstate bypass the transaction logic. We might want to change that. In anyway, let us disarm this bug nest before it actually explode.
Mon, 20 Feb 2023 16:31:36 +0100 dirstate: track that changes are pending in a transaction
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 16:31:36 +0100] rev 50171
dirstate: track that changes are pending in a transaction Nothing is currently broken because if this, but this make the `_invalidated_context` attribute more accurate. Being more accurate here will help us later, when dealing with `status` call.
Tue, 21 Feb 2023 17:43:43 +0100 dirstate: add small asserts for double security
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 17:43:43 +0100] rev 50170
dirstate: add small asserts for double security We don't need this, but it does not hurt.
Mon, 20 Feb 2023 15:58:17 +0100 dirstate: simplify the invalidation management on context exit
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 15:58:17 +0100] rev 50169
dirstate: simplify the invalidation management on context exit Since the `invalidate` call will directly reset the `_invalidated_context` attribut, we can simplify the code. In the same go, we move most of the logic out of the `finally` clause. It seems cleaner and safer. If we are handling an exception, we don't need the `write` code anyway.
Mon, 20 Feb 2023 15:52:55 +0100 dirstate: use the new `check_invalidated` decorator for `_changing`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 15:52:55 +0100] rev 50168
dirstate: use the new `check_invalidated` decorator for `_changing` WeeeEEeee, less code.
Tue, 21 Feb 2023 22:25:20 +0100 dirstate: introduce a check_invalidated decorator
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 22:25:20 +0100] rev 50167
dirstate: introduce a check_invalidated decorator This is a common need, so let us consolidate it to simplify the code.
Sun, 19 Feb 2023 03:21:12 +0100 dirstate: warn if dirty when starting an edition
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 19 Feb 2023 03:21:12 +0100] rev 50166
dirstate: warn if dirty when starting an edition The dirstate should be clean before we start changing it. Otherwise we might write unrelated changes. Having a dirty dirstate laying around is also suspicious. This is similar to what we do when opening a new transaction, but this time this affect dirstate changes outside of a transaction.
Tue, 21 Feb 2023 03:22:51 +0100 large-files: make sure we write newly initialized standin file early
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 21 Feb 2023 03:22:51 +0100] rev 50165
large-files: make sure we write newly initialized standin file early Any changing context will have to initialized it before anything else. Not flushing the default (pre-change) content mean we would enter the changing context with a dirty dirstate, which is odd.
Mon, 20 Feb 2023 14:06:15 +0100 dirstate: mark `clear` and `rebuild` as `require_changing_parents`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 14:06:15 +0100] rev 50164
dirstate: mark `clear` and `rebuild` as `require_changing_parents` Yeah, more scoping!
Mon, 20 Feb 2023 11:37:02 +0100 dirstate: add a comment about the semantic of `dirstate.clear`
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 11:37:02 +0100] rev 50163
dirstate: add a comment about the semantic of `dirstate.clear` This method is weird, lets flag it as such.
Mon, 20 Feb 2023 14:05:19 +0100 debugrebuildstate: wrap the operation in a `changing_parents` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 14:05:19 +0100] rev 50162
debugrebuildstate: wrap the operation in a `changing_parents` context This ismaybe a "changing_files" case? However this would be the only usage of `rebuild` outside a `changing_parents` context and this is a debug command, so lets not make the code base more complex because of that one command.
Sun, 19 Feb 2023 02:50:46 +0100 strip: use a `changing_parents` context for --keep update
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 19 Feb 2023 02:50:46 +0100] rev 50161
strip: use a `changing_parents` context for --keep update These are now properly scoped. note: it would be neat to reuse this in `hg rollback`.
Sun, 19 Feb 2023 02:47:28 +0100 mq: wrap the dirstate's rebuild in a `changing_parents` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 19 Feb 2023 02:47:28 +0100] rev 50160
mq: wrap the dirstate's rebuild in a `changing_parents` context This code is dealing with `qreshesh` failure. In that case the working copy will be left on the parent of the refreshed patch, so the parents are changing and `changing_parents` make sens.
Mon, 20 Feb 2023 11:37:05 +0100 lfconvert: use a `changing_parents` context to clear the dirstate
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Feb 2023 11:37:05 +0100] rev 50159
lfconvert: use a `changing_parents` context to clear the dirstate Not sure if this is the right context, but it works and it is consistent with the other usages of `dirstate.clear`.
(0) -30000 -10000 -3000 -1000 -300 -100 -96 +96 +100 +300 +1000 tip