Mon, 07 Jun 2021 17:29:32 +0530 rhg: propogate error coming from HgError::Abort to CommandError
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 07 Jun 2021 17:29:32 +0530] rev 47414
rhg: propogate error coming from HgError::Abort to CommandError Differential Revision: https://phab.mercurial-scm.org/D10839
Mon, 07 Jun 2021 17:27:49 +0530 rhg: add exit code to HgError::Abort()
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 07 Jun 2021 17:27:49 +0530] rev 47413
rhg: add exit code to HgError::Abort() My previous attempts to have rhg end with correct exit code was more of bug hunting. I found cases which were failing and fixed them. But as one might expect, more tests started failing. Let's add exit code `HgError::Abort()` and make it users explicitly tell what exit code they want. Differential Revision: https://phab.mercurial-scm.org/D10838
Mon, 07 Jun 2021 17:19:46 +0530 rhg: split non_repo_config and `--config` loading in different functions
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 07 Jun 2021 17:19:46 +0530] rev 47412
rhg: split non_repo_config and `--config` loading in different functions This will help us in better handling of error caused when trying to load `--config` values. Differential Revision: https://phab.mercurial-scm.org/D10837
Mon, 24 May 2021 16:27:54 +0530 rhg: look for repository in ancestors also instead of cwd only
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 24 May 2021 16:27:54 +0530] rev 47411
rhg: look for repository in ancestors also instead of cwd only Last patch introduced config reading at startup to parse value of `--repository` flag. However, that patch only tried to check for current repository at current working directory and not it's ancestors. This patch fixes that. Differential Revision: https://phab.mercurial-scm.org/D10767
Sun, 11 Apr 2021 00:50:10 +0530 rhg: read [paths] for `--repository` value
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Apr 2021 00:50:10 +0530] rev 47410
rhg: read [paths] for `--repository` value hg parses `-R` and `--repository` CLI arguments "early" in order to know which local repository to load config from. (Config can then affect whether or how to fall back.) The value of of those arguments can be not only a filesystem path, but also an alias configured in the `[paths]` section. This part was missing in rhg and this patch implements that. The current patch still lacks functionality to read config of current repository if we are not at root of repo. That will be fixed in upcoming patches. A new crate `home` is added to get path of home directory. Differential Revision: https://phab.mercurial-scm.org/D10296
Mon, 07 Jun 2021 17:10:35 -0400 merge: with stable
Augie Fackler <augie@google.com> [Mon, 07 Jun 2021 17:10:35 -0400] rev 47409
merge: with stable
Sun, 30 May 2021 18:09:29 +0200 revlog: allow to pass an existing docket to `_loadindex()`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 18:09:29 +0200] rev 47408
revlog: allow to pass an existing docket to `_loadindex()` This will be when switching undelying files, for examples during censors and strip operation with rvlog-v2. Differential Revision: https://phab.mercurial-scm.org/D10800
Sun, 30 May 2021 18:10:15 +0200 revlog: add a ways to blacklist some revision when searching for a delta
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 18:10:15 +0200] rev 47407
revlog: add a ways to blacklist some revision when searching for a delta This will be useful to recompute appropriate deltas one the fly during censor/strip operation with revlog-v2. Differential Revision: https://phab.mercurial-scm.org/D10799
Sun, 30 May 2021 18:08:52 +0200 util: add `nb_bytes` argument to `copyfile` to partially copy a file
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 18:08:52 +0200] rev 47406
util: add `nb_bytes` argument to `copyfile` to partially copy a file When set, this allow to copy only the first `nb_bytes` of a file. This will be useful for censor/strip operation with revlogv2. Differential Revision: https://phab.mercurial-scm.org/D10798
Sun, 30 May 2021 16:20:36 +0200 revlog: move `revisioninfo` in `revlogutils`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 16:20:36 +0200] rev 47405
revlog: move `revisioninfo` in `revlogutils` We will need it in other utility module. So lets extract it from `revlog.py`, the module is too large already anyway. Differential Revision: https://phab.mercurial-scm.org/D10797
Sun, 30 May 2021 17:11:49 +0200 revlog: use the `entry` function in bundlerepo
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:11:49 +0200] rev 47404
revlog: use the `entry` function in bundlerepo We can use some of the default value again! Differential Revision: https://phab.mercurial-scm.org/D10796
Sun, 30 May 2021 17:11:21 +0200 revlog: use entry in revlogv0.py
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:11:21 +0200] rev 47403
revlog: use entry in revlogv0.py This make things clearer and we can reply on some of the default value directly. Differential Revision: https://phab.mercurial-scm.org/D10795
Sun, 30 May 2021 17:11:10 +0200 revlog: use the new `entry` function in revlog.py
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:11:10 +0200] rev 47402
revlog: use the new `entry` function in revlog.py This just make the construction of the tuple clearer. Differential Revision: https://phab.mercurial-scm.org/D10794
Sun, 30 May 2021 17:10:56 +0200 revlog: add a function to build index entry tuple
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 17:10:56 +0200] rev 47401
revlog: add a function to build index entry tuple Keeping index entry as tuple make sense for performance reason, however it does not means we need to manually build that tuple for all piece of python code that are not performance critical. So we add a nice function responsible to build the tuple using argument using explicit keyword argument. Differential Revision: https://phab.mercurial-scm.org/D10793
Sun, 30 May 2021 16:19:36 +0200 revlog: move `offset_type` to `revlogutils`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 16:19:36 +0200] rev 47400
revlog: move `offset_type` to `revlogutils` This multiple module are using this so it make sense to move it at the utility level. Differential Revision: https://phab.mercurial-scm.org/D10792
Sat, 22 May 2021 00:06:22 +0200 revlog: move entry documentation alongside new related constants
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 22 May 2021 00:06:22 +0200] rev 47399
revlog: move entry documentation alongside new related constants Accessing individual index-entry element is usually done using integer directly. This is presumably for "performance reasons". However as the index entry gain more and more element it seems useful to get the option to use symbolic constant to access item, for both clarify and versatility. We will probably keep using integer for performance critical path, but less critical code may start using them now that they are declared. Differential Revision: https://phab.mercurial-scm.org/D10791
Fri, 21 May 2021 20:08:11 +0200 censor: drop size limitation on the tombstone
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 21 May 2021 20:08:11 +0200] rev 47398
censor: drop size limitation on the tombstone This limitation seems to date back from a previous implementation of censors, were the revision were censored" in place. For a long while the implementation actually involved rewriting the revlog before replacing the original data. So it looks like we can safely remove this limitation. The tests suite agrees. Differential Revision: https://phab.mercurial-scm.org/D10790
Sat, 29 May 2021 00:11:56 +0200 revlog: move censoring code in a dedicated module
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 29 May 2021 00:11:56 +0200] rev 47397
revlog: move censoring code in a dedicated module This code is quite specific and we are about to add more of it for revlog-v2 (and other derived version). So we move this code in a dedicated module in `mercurial/revlogutils/`. This looks like a good fit. The diff is huge because I used `hg copy` to create the new file so that we keep the history of the censor code. Differential Revision: https://phab.mercurial-scm.org/D10789
Sat, 29 May 2021 00:11:32 +0200 censor: reduce risk of censor test blowing up output limit
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 29 May 2021 00:11:32 +0200] rev 47396
censor: reduce risk of censor test blowing up output limit The censored file is really big, and we keep using `hg cat` on it, with the assumption that it is censored. However, when it is not censored, the amount of extra line output is huge and quickly saturate the backlog of terminal and CI system. Differential Revision: https://phab.mercurial-scm.org/D10788
Fri, 28 May 2021 23:41:17 +0200 revlog: store sidedata in their own file
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 May 2021 23:41:17 +0200] rev 47395
revlog: store sidedata in their own file This makes sidedata manipulation simpler and results in more compact data when traversing either data or sidedata. Differential Revision: https://phab.mercurial-scm.org/D10787
Fri, 28 May 2021 23:41:12 +0200 revlog: fix docket.date_filepath docstring
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 May 2021 23:41:12 +0200] rev 47394
revlog: fix docket.date_filepath docstring This was copy-pasted too quickly. Differential Revision: https://phab.mercurial-scm.org/D10786
Thu, 27 May 2021 04:09:30 +0200 revlog: use dedicated code for reading sidedata
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 27 May 2021 04:09:30 +0200] rev 47393
revlog: use dedicated code for reading sidedata We are about to introduce a new, dedicated, file to store sidedata. Before doing so, we make sidedata reading go through different code as reading data chunk. This will simplify some of the complexity of the next changesets. The reading is very simple right now and will need some improvement later to reuse some of the caching strategy we use for the data file. Differential Revision: https://phab.mercurial-scm.org/D10785
Thu, 27 May 2021 04:09:10 +0200 revlog: simplify "partial read" error message
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 27 May 2021 04:09:10 +0200] rev 47392
revlog: simplify "partial read" error message We are about to reuse this message in more places and the current handling is pretty hard to read. So we eat two pie with one stone and clean up this. Differential Revision: https://phab.mercurial-scm.org/D10784
Thu, 27 May 2021 03:41:02 +0200 revlog: no longer return sidedata from `_revisiondata`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 27 May 2021 03:41:02 +0200] rev 47391
revlog: no longer return sidedata from `_revisiondata` All users have been migrated. When they was introduced sidedata where grouped with the actual revision data and unpacking one came with the other. Sidedata moved be stored "independently" and it no longer make sense to retrieve both at the same time unconditionnaly. Differential Revision: https://phab.mercurial-scm.org/D10783
Thu, 27 May 2021 03:28:15 +0200 revlog: use `self.sidedata` directly in `revlog.clone`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 27 May 2021 03:28:15 +0200] rev 47390
revlog: use `self.sidedata` directly in `revlog.clone` We want to change `revlog._revisiondata` signature, so we need to migrate users away. Differential Revision: https://phab.mercurial-scm.org/D10782
Thu, 27 May 2021 03:23:34 +0200 revlog: use `self.sidedata` directly to construct changelogrevision
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 27 May 2021 03:23:34 +0200] rev 47389
revlog: use `self.sidedata` directly to construct changelogrevision We want to change `revlog._revisiondata` signature, so we need to migrate users away. Differential Revision: https://phab.mercurial-scm.org/D10781
Thu, 27 May 2021 03:21:53 +0200 revlog: implement sidedata without using _revisiondata
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 27 May 2021 03:21:53 +0200] rev 47388
revlog: implement sidedata without using _revisiondata When they was introduced sidedata where grouped with the actual revision data and unpacking one came with the other. Sidedata moved be stored "independently" and it no longer make sense to retrieve both at the same time unconditionnaly. We start with changeset the implementation of the `revlog.sidedata` command to no longer use `self._revisiondata`. More users need to be migrated to direct usage of this `revlog.sidedata` method. This will be done in the coming changesets. Differential Revision: https://phab.mercurial-scm.org/D10780
Fri, 28 May 2021 23:44:58 +0200 revlogv2: drop "sidedatacompression" from the list of todos
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 May 2021 23:44:58 +0200] rev 47387
revlogv2: drop "sidedatacompression" from the list of todos This was implemented in c4dbb7636a12 and 07641bafa646, but I forgot to drop it from the todo-list. Differential Revision: https://phab.mercurial-scm.org/D10779
Wed, 02 Jun 2021 10:00:50 +0200 rust: Use a maintained crate for SHA-1 hashing
Simon Sapin <simon.sapin@octobus.net> [Wed, 02 Jun 2021 10:00:50 +0200] rev 47386
rust: Use a maintained crate for SHA-1 hashing https://crates.io/crates/rust-crypto hasn’t been updated in 5 years. This doesn’t neccesarily mean there’s anything wrong with it, but if something comes up it’s preferable to rely on libraries that have active maintainers. Use https://crates.io/crates/sha-1 from https://github.com/RustCrypto instead Differential Revision: https://phab.mercurial-scm.org/D10835
Wed, 02 Jun 2021 18:03:43 +0200 rust: Parse "subinclude"d files along the way, not later
Simon Sapin <simon.sapin@octobus.net> [Wed, 02 Jun 2021 18:03:43 +0200] rev 47385
rust: Parse "subinclude"d files along the way, not later When parsing a `.hgignore` file and encountering an `include:` line, the included file is parsed recursively right then in a depth-first fashion. With `subinclude:` however included files were parsed (recursively) much later. This changes it to be expanded during parsing, like `.hgignore`. The motivation for this is an upcoming changeset that needs to detect changes in which files are ignored or not. The plan is to hash all ignore files while they are being read, and store that hash in the dirstate (in v2 format). In order to allow a potential alternative implementations to read that format, the algorithm to compute that hash must be documented. Having a well-defined depth-first ordering for the tree of (sub-)included files makes that easier. Differential Revision: https://phab.mercurial-scm.org/D10834
Wed, 02 Jun 2021 18:14:44 +0200 rust: Make some file path parameters less generic
Simon Sapin <simon.sapin@octobus.net> [Wed, 02 Jun 2021 18:14:44 +0200] rev 47384
rust: Make some file path parameters less generic These are not widely used APIs that benefit from being maximally flexible, taking an explicit `&Path` borrow is fine and simplifies their internals. Differential Revision: https://phab.mercurial-scm.org/D10833
Mon, 26 Apr 2021 22:59:56 +0200 convert-bazaar: use breezy package instead of old bzr one
Raphaël Gomès <rgomes@octobus.net> [Mon, 26 Apr 2021 22:59:56 +0200] rev 47383
convert-bazaar: use breezy package instead of old bzr one Breezy is the most recent of the two, and works on Python 3 while being compatible with the (old) Bazaar file format. This patch contains a variety of unicode <-> bytes changes, API breakage fixing, restoring failing imports and changing the executable from `bzr` to `brz`. I recommend using the debian packages for `brz` and `python3-breezy` (3.1+), because the pip package seems to be haunted by radioactive dragons. Differential Revision: https://phab.mercurial-scm.org/D10513
Wed, 21 Apr 2021 10:58:21 +0200 bzr: only support bzr conversion on Python3
Raphaël Gomès <rgomes@octobus.net> [Wed, 21 Apr 2021 10:58:21 +0200] rev 47382
bzr: only support bzr conversion on Python3 Python 2 support will be dropped from Mercurial before anyone needs to do a bzr -> hg conversion on Python 2 again. Bazaar tests were broken with the new lib anyway, which we'll get into in the next patches. Differential Revision: https://phab.mercurial-scm.org/D10512
Tue, 01 Jun 2021 22:38:29 -0700 rewriteutil: add pointer to help text when rewrite would cause divergence
Martin von Zweigbergk <martinvonz@google.com> [Tue, 01 Jun 2021 22:38:29 -0700] rev 47381
rewriteutil: add pointer to help text when rewrite would cause divergence The evolve extension's version of the hint has this pointer. I missed it when I moved it to core. This is pretty much the same as D10723. Turns out I missed two places :( Differential Revision: https://phab.mercurial-scm.org/D10832
Tue, 25 May 2021 09:20:30 +0200 rhg: Add support for dirstate-v2
Simon Sapin <simon.sapin@octobus.net> [Tue, 25 May 2021 09:20:30 +0200] rev 47380
rhg: Add support for dirstate-v2 Differential Revision: https://phab.mercurial-scm.org/D10804
Wed, 26 May 2021 11:53:37 +0200 rhg: Remove some intermediate Vecs in `rhg files`
Simon Sapin <simon.sapin@octobus.net> [Wed, 26 May 2021 11:53:37 +0200] rev 47379
rhg: Remove some intermediate Vecs in `rhg files` Instead of calling `parse_dirstate` which then calls `parse_dirstate_entries`, call the latter directly in order to skip some intermediate steps. Differential Revision: https://phab.mercurial-scm.org/D10803
Tue, 01 Jun 2021 15:19:08 -0700 merge: make applyupdates() not mutate mresult argument
Martin von Zweigbergk <martinvonz@google.com> [Tue, 01 Jun 2021 15:19:08 -0700] rev 47378
merge: make applyupdates() not mutate mresult argument We have an extension at work that overrides `merge.applyupdates()` to make it skip some writes and instead instruct the virtual filesystem we use to get a different version. That override doesn't work correctly when doing `hg co -m` and there's a modified file in the dirstate that's deleted in the destination. That's because `applyupdates()` mutates its `mresult` argument and our extension had passed in a modified copied of `mresult` to the overridden function, which resulted in the mutation not having any effect. This patch fixes that by letting the caller (i.e. `merge._update()`) update `mresult` with the extra actions instead. Besides fixing our internal extension, that seems cleaner to me anyway (better to not mutate `mresult` only in some cases and we can skip some of the logic if we're not going to update the dirstate anyway). Differential Revision: https://phab.mercurial-scm.org/D10830
Thu, 03 Jun 2021 16:12:03 +0200 index: use an explicit constant for INDEX_HEADER format and use it for docket
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 03 Jun 2021 16:12:03 +0200] rev 47377
index: use an explicit constant for INDEX_HEADER format and use it for docket This avoid leaking python-3.6 compatibility details too much. Differential Revision: https://phab.mercurial-scm.org/D10831
Tue, 01 Jun 2021 09:18:27 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:18:27 +0200] rev 47376
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10822
Tue, 01 Jun 2021 09:18:20 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:18:20 +0200] rev 47375
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. We extract the long message in a module level constant for clarity. Differential Revision: https://phab.mercurial-scm.org/D10821
Tue, 01 Jun 2021 09:14:58 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:14:58 +0200] rev 47374
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10820
Tue, 01 Jun 2021 09:13:33 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:13:33 +0200] rev 47373
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. We extract the long message in a module level constant for clarity. Differential Revision: https://phab.mercurial-scm.org/D10819
Tue, 01 Jun 2021 09:11:54 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:11:54 +0200] rev 47372
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10818
Tue, 01 Jun 2021 09:11:07 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:11:07 +0200] rev 47371
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10817
Tue, 01 Jun 2021 09:11:01 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:11:01 +0200] rev 47370
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10816
Tue, 01 Jun 2021 09:09:01 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:09:01 +0200] rev 47369
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. We extract the long message in a module level constant for clarity. Differential Revision: https://phab.mercurial-scm.org/D10815
Tue, 01 Jun 2021 09:06:33 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:06:33 +0200] rev 47368
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10814
Tue, 01 Jun 2021 09:05:53 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:05:53 +0200] rev 47367
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10813
Tue, 01 Jun 2021 09:05:23 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:05:23 +0200] rev 47366
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10812
Tue, 01 Jun 2021 09:03:48 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:03:48 +0200] rev 47365
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10811
Tue, 01 Jun 2021 09:03:24 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:03:24 +0200] rev 47364
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. We extract the long message in a module level constant for clarity. Differential Revision: https://phab.mercurial-scm.org/D10810
Tue, 01 Jun 2021 09:01:23 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 09:01:23 +0200] rev 47363
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10809
Tue, 01 Jun 2021 08:59:50 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 08:59:50 +0200] rev 47362
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10808
Tue, 01 Jun 2021 08:59:07 +0200 verify: use some intermediate variables instead of a multi-liner
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 08:59:07 +0200] rev 47361
verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. Differential Revision: https://phab.mercurial-scm.org/D10807
Tue, 01 Jun 2021 08:58:53 +0200 verify: expand a one liner into explicit commands
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 08:58:53 +0200] rev 47360
verify: expand a one liner into explicit commands The result is not longer, but it is more edible. Differential Revision: https://phab.mercurial-scm.org/D10806
Tue, 01 Jun 2021 08:54:53 +0200 verify: align a comment line
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 01 Jun 2021 08:54:53 +0200] rev 47359
verify: align a comment line This argument description is back with it comrade. Differential Revision: https://phab.mercurial-scm.org/D10805
Tue, 01 Jun 2021 16:55:59 +0200 dirstate-v2: Drop parent directory cache when removing a dirstate node
Simon Sapin <simon.sapin@octobus.net> [Tue, 01 Jun 2021 16:55:59 +0200] rev 47358
dirstate-v2: Drop parent directory cache when removing a dirstate node The premise of the directory cache is that the dirstate contains child nodes for every entry that `read_dir` would return. When removing nodes, that may not be the case anymore so the cache should be invalidated. Differential Revision: https://phab.mercurial-scm.org/D10829
Mon, 31 May 2021 19:54:41 +0200 dirstate-v2: Add --dirs to debugdirstate command
Simon Sapin <simon.sapin@octobus.net> [Mon, 31 May 2021 19:54:41 +0200] rev 47357
dirstate-v2: Add --dirs to debugdirstate command `hg debugdirstate --dirs` also shows information stored in the dirstate (for `read_dir` caching) about directories. Differential Revision: https://phab.mercurial-scm.org/D10828
Mon, 31 May 2021 18:35:44 +0200 dirstate-v2: Write .hg/dirstate back to disk on directory cache changes
Simon Sapin <simon.sapin@octobus.net> [Mon, 31 May 2021 18:35:44 +0200] rev 47356
dirstate-v2: Write .hg/dirstate back to disk on directory cache changes Differential Revision: https://phab.mercurial-scm.org/D10827
Fri, 28 May 2021 11:48:59 +0200 dirstate-v2: Skip readdir in status based on directory mtime
Simon Sapin <simon.sapin@octobus.net> [Fri, 28 May 2021 11:48:59 +0200] rev 47355
dirstate-v2: Skip readdir in status based on directory mtime When calling `read_dir` during `status` and the directory is found to be eligible for caching (see code comments), write the directory’s mtime to the dirstate. The presence of a directory mtime in the dirstate is meaningful and indicates eligibility. When an eligible directory mtime is found in the dirstate and `stat()` shows that the mtime has not changed, `status` can skip calling `read_dir` again and instead rely on the names of child nodes in the dirstate tree. The `tempfile` crate is used to create a temporary file in order to use its modification time as "current time" with the same truncation as other files and directories would have in their own modification time. Differential Revision: https://phab.mercurial-scm.org/D10826
Thu, 27 May 2021 18:40:54 +0200 dirstate-v2: Allow tree nodes without an entry to store a timestamp
Simon Sapin <simon.sapin@octobus.net> [Thu, 27 May 2021 18:40:54 +0200] rev 47354
dirstate-v2: Allow tree nodes without an entry to store a timestamp Timestamps are stored on 96 bits: * 64 bits for the signed number of seconds since the Unix epoch * 32 bits for the nanoseconds in the `0 <= ns < 1_000_000_000` range For now timestamps are not used or set yet. Differential Revision: https://phab.mercurial-scm.org/D10825
Fri, 28 May 2021 20:07:27 +0200 dirstate-tree: Change status() results to not borrow DirstateMap
Simon Sapin <simon.sapin@octobus.net> [Fri, 28 May 2021 20:07:27 +0200] rev 47353
dirstate-tree: Change status() results to not borrow DirstateMap The `status` function takes a `&'tree mut DirstateMap<'on_disk>` parameter. `'on_disk` borrows a read-only byte buffer with the contents of the `.hg/dirstate` file. `DirstateMap` internally uses represents file paths as `std::borrow::Cow<'on_disk, HgPath>`, which borrows the byte buffer when possible and allocates an owned string if not, such as for files added to the dirstate after it was loaded from disk. Previously the return type of of `status` has a `'tree` lifetime, meaning it could borrow all paths from the `DirstateMap`. With this changeset, that lifetime is changed to `'on_disk` meaning that only paths from the byte buffer can be borrowed, and paths allocated by `DirstateMap` must be copied. Usually most paths are in the byte buffer, and most paths are not part of the return value of `status`, so the number of extra copies should be small. This change will enable `status` to mutate the `DirstateMap` after it has finished constructing its return value. Previously such mutation would be prevented by possible on-going borrows. Differential Revision: https://phab.mercurial-scm.org/D10824
Fri, 28 May 2021 12:16:14 +0200 dirstate-tree: Fix status algorithm with unreadable directory
Simon Sapin <simon.sapin@octobus.net> [Fri, 28 May 2021 12:16:14 +0200] rev 47352
dirstate-tree: Fix status algorithm with unreadable directory When reading a directory fails such as because of insufficient permissions, it should be treated as empty by status instead of skipped entirely. Differential Revision: https://phab.mercurial-scm.org/D10823
Tue, 25 May 2021 16:46:32 -0700 docket: make compatible with py3.6, where Struct.format is bytes
Martin von Zweigbergk <martinvonz@google.com> [Tue, 25 May 2021 16:46:32 -0700] rev 47351
docket: make compatible with py3.6, where Struct.format is bytes Differential Revision: https://phab.mercurial-scm.org/D10770
Sun, 30 May 2021 22:12:48 +0200 revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 22:12:48 +0200] rev 47350
revlogv2: make sure bundling pick a compatible bundle format Before this change, revlog-v2 repository where bundled using the incompatible "v1" format. Differential Revision: https://phab.mercurial-scm.org/D10802
Sun, 30 May 2021 20:42:51 +0200 censor: do not process sidedata of censored revision while bundling
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 30 May 2021 20:42:51 +0200] rev 47349
censor: do not process sidedata of censored revision while bundling The revision is censored, we should ignore it. Differential Revision: https://phab.mercurial-scm.org/D10801
Fri, 28 May 2021 20:00:27 +0200 changegroup: fix deltachunk API to be consistent from one class to another
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 May 2021 20:00:27 +0200] rev 47348
changegroup: fix deltachunk API to be consistent from one class to another Depending of the subclass the 8th index of `chunkdata` items was either a sidedata dict of a proto_flags integer. We have not fixed the inconsistency and we already return fixed "delta" items from `deltaiter`. Differential Revision: https://phab.mercurial-scm.org/D10778
Thu, 27 May 2021 12:10:59 -0400 fuzz: add hg to sys.path when constructing mpatch corpus
Augie Fackler <augie@google.com> [Thu, 27 May 2021 12:10:59 -0400] rev 47347
fuzz: add hg to sys.path when constructing mpatch corpus Differential Revision: https://phab.mercurial-scm.org/D10777
Wed, 19 May 2021 16:18:16 +0200 dirstate-tree: Skip readdir() in `hg status -mard`
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 16:18:16 +0200] rev 47346
dirstate-tree: Skip readdir() in `hg status -mard` When running the status algorithm in a mode where we don’t list unknown or ignored files, all we care about are files that are listed in the dirstate. We can there for skip making expensive calls to readdir() to list the contents of filesystem directories, and instead only run stat() to get the filesystem state of files listed in the dirstate. (This state may be an error for files that don’t exist anymore on the filesystem.) On 16 CPU threads, this reduces the time spent in the `status()` function for `hg status -mard` on an old snapshot of mozilla-central from ~70ms to ~50ms. Differential Revision: https://phab.mercurial-scm.org/D10752
Wed, 19 May 2021 13:15:00 +0200 dirstate-v2: Parse the dirstate lazily, with copy-on-write nodes
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47345
dirstate-v2: Parse the dirstate lazily, with copy-on-write nodes TODO: more description Differential Revision: https://phab.mercurial-scm.org/D10751
Wed, 19 May 2021 13:15:00 +0200 dirstate-v2: Make the dirstate bytes buffer available in more places
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47344
dirstate-v2: Make the dirstate bytes buffer available in more places Differential Revision: https://phab.mercurial-scm.org/D10750
Wed, 19 May 2021 13:15:00 +0200 dirstate-v2: Make more APIs fallible, returning Result
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47343
dirstate-v2: Make more APIs fallible, returning Result When parsing becomes lazy, parse error will potentially happen in more places. This propagates such errors to callers. Differential Revision: https://phab.mercurial-scm.org/D10749
Wed, 19 May 2021 13:15:00 +0200 dirstate-v2: Add a zero-size error type for dirstate v2 parse errors
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47342
dirstate-v2: Add a zero-size error type for dirstate v2 parse errors This error should only happen if Mercurial is buggy or the file is corrupted. It indicates for example that: * A part of the file refers to another part, and the byte offset or item count would cause reading out of bounds, beyond the end of the file. * The byte for an entry state has an invalid value When parsing becomes lazy, many more functions will return a `Result` with this error. Making it zero-size reduces the work that the `?` operator needs to do to pass around the error value. Differential Revision: https://phab.mercurial-scm.org/D10748
Wed, 19 May 2021 13:15:00 +0200 dirstate-tree: Add `NodeRef` and `ChildNodesRef` enums
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47341
dirstate-tree: Add `NodeRef` and `ChildNodesRef` enums They are used instead of `&Node` and `&ChildNodes` respectively. The `ChildNodes` type alias also becomes a similar enum. For now they only have one variant each, to be extended later. Adding enums now forces various use sites go through new methods instead of manipulating the underlying data structure directly. Differential Revision: https://phab.mercurial-scm.org/D10747
Wed, 19 May 2021 13:15:00 +0200 rust: Return owned instead of borrowed DirstateEntry in DirstateMap APIs
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47340
rust: Return owned instead of borrowed DirstateEntry in DirstateMap APIs This will enable the tree-based DirstateMap to not always have an actual DirstateEntry in memory for all nodes, but construct it on demand. Differential Revision: https://phab.mercurial-scm.org/D10746
Wed, 19 May 2021 13:15:00 +0200 dirstate-tree: Downgrade `&mut Node` to `&Node` in status and serialization
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47339
dirstate-tree: Downgrade `&mut Node` to `&Node` in status and serialization Mutable access is not used, and upcoming changes will make it more costly (with copy-on-write nodes that can be read from disk representation) Differential Revision: https://phab.mercurial-scm.org/D10745
Wed, 19 May 2021 13:15:00 +0200 dirstate-tree: Remove DirstateMap::iter_node_data_mut
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 13:15:00 +0200] rev 47338
dirstate-tree: Remove DirstateMap::iter_node_data_mut In an upcoming changeset we want DirstateMap to be able to work directly with nodes in their "on disk" representation, without always allocating corresponding in-memory data structures. Nodes would have two possible representations: one immutable "on disk" refering to the bytes buffer of the contents of the .hg/dirstate file, and one mutable with HashMap like the curren data structure. These nodes would have copy-on-write semantics: when an immutable node would need to be mutated, instead we allocate new mutable node for it and its ancestors. A mutable iterator of the entire tree would still be possible, but it would become much more expensive since we’d need to allocate mutable nodes for everything. Instead, remove this iterator. It was only used to clear ambiguous mtimes while serializing the `DirstateMap`. Instead clearing and serialization are now two separate passes. Clearing first uses an immutable iterator to collect the paths of nodes that need to be cleared, then accesses only those nodes mutably. Differential Revision: https://phab.mercurial-scm.org/D10744
Fri, 28 May 2021 17:33:20 -0400 merge with stable
Matt Harbison <matt_harbison@yahoo.com> [Fri, 28 May 2021 17:33:20 -0400] rev 47337
merge with stable
Wed, 26 May 2021 21:46:45 +0200 revlog: close the index file handle after the data one
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 26 May 2021 21:46:45 +0200] rev 47336
revlog: close the index file handle after the data one This make sure the data file is flushed before the index. preventing the index to reference unflushed data. Differential Revision: https://phab.mercurial-scm.org/D10776
Wed, 26 May 2021 21:35:51 +0200 revlog: simplify the try nesting in the `_writing` context
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 26 May 2021 21:35:51 +0200] rev 47335
revlog: simplify the try nesting in the `_writing` context Lets use a single try, with conditional cleanup. This make is easier to add a file handle dedicated to sidedata. Differential Revision: https://phab.mercurial-scm.org/D10775
Thu, 20 May 2021 21:54:21 +0200 revlogv2: add a `get_data` helper to grab the next piece of docket
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 20 May 2021 21:54:21 +0200] rev 47334
revlogv2: add a `get_data` helper to grab the next piece of docket This make the processing more compact but abstracting repetitive processing away. Differential Revision: https://phab.mercurial-scm.org/D10774
Thu, 20 May 2021 21:48:53 +0200 revlogv2: simplify and clarify the processing of each entry
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 20 May 2021 21:48:53 +0200] rev 47333
revlogv2: simplify and clarify the processing of each entry As we add more entries and some of them has non trivial processing it seems useful to make the processing leaner and clearly separated to simplify futures patches. Differential Revision: https://phab.mercurial-scm.org/D10773
Wed, 19 May 2021 16:55:36 +0200 revlogv2: use a unique filename for data
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 19 May 2021 16:55:36 +0200] rev 47332
revlogv2: use a unique filename for data Having a unique data will allow for ambiguity less rewriting of revlog content, something useful to clarify handling of some operation like censoring or stripping. Differential Revision: https://phab.mercurial-scm.org/D10772
Tue, 18 May 2021 15:07:17 +0200 revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 18 May 2021 15:07:17 +0200] rev 47331
revlogv2: use a unique filename for index Having a unique index will allow for ambiguity less rewriting of revlog content, something useful to clarify handling of some operation like censoring or stripping. Differential Revision: https://phab.mercurial-scm.org/D10771
Sat, 22 May 2021 17:35:54 +0200 rhg: A missing .hg/dirstate file is not an error
Simon Sapin <simon.sapin@octobus.net> [Sat, 22 May 2021 17:35:54 +0200] rev 47330
rhg: A missing .hg/dirstate file is not an error Instead treat it as like an empty file Differential Revision: https://phab.mercurial-scm.org/D10766
Sat, 22 May 2021 17:32:09 +0200 rhg: Sort `rhg status` output correctly
Simon Sapin <simon.sapin@octobus.net> [Sat, 22 May 2021 17:32:09 +0200] rev 47329
rhg: Sort `rhg status` output correctly * The relative order of states is: modified, added, removed, deleted, unknown, ignored, clean * Files in the same state should be sorted by name, regardless of whether or not the were in "unsure" state based on metadata alone. Differential Revision: https://phab.mercurial-scm.org/D10765
Wed, 19 May 2021 18:35:43 +0200 dirstate-v2: Add `hg debugupgraderepo` command support
Simon Sapin <simon.sapin@octobus.net> [Wed, 19 May 2021 18:35:43 +0200] rev 47328
dirstate-v2: Add `hg debugupgraderepo` command support This command changes changes the file formats used inside an existing repository to what they would be in a new repository with the current config. For example: hg debugupgraderepo --config format.exp-dirstate-v2=1 --run hg debugupgraderepo --config format.exp-dirstate-v2=0 --run If a repository has a dirstate in v1 format, the first command would upgrade it to dirstate-v2. Conversely, if a repository has a dirstate in v2 format, the second command would downgrade it to v1. (Both may also run some unrelated upgrades.) Since `format.exp-dirstate-v2` is currently disabled by default, not specifying it in `--config` or any configuration file would result in the second command. Differential Revision: https://phab.mercurial-scm.org/D10769
Fri, 21 May 2021 17:12:47 +0200 upgrade: Use `improvement` subclasses everywhere, not instances
Simon Sapin <simon.sapin@octobus.net> [Fri, 21 May 2021 17:12:47 +0200] rev 47327
upgrade: Use `improvement` subclasses everywhere, not instances This changes the source definition of optimizations to match that of formats: a subclass with a decorator, instead of an instance passed to a function call. Not having any instance removes the confusion between class attributes and instance attributes, which were used interchangeably. Differential Revision: https://phab.mercurial-scm.org/D10768
Tue, 11 May 2021 01:05:38 -0400 exewrapper: avoid directly linking against python3X.dll
Matt Harbison <matt_harbison@yahoo.com> [Tue, 11 May 2021 01:05:38 -0400] rev 47326
exewrapper: avoid directly linking against python3X.dll Subsequent code calls `LoadLibrary()` to attempt to load the DLL, but because of this symbol reference, there is an attempt to load the DLL used during the build prior to `_main()` running. This causes the whole process to fail if the DLL isn't in the standard search path. That also means it will never load the DLL for HackableMercurial. (Maybe we should get rid of that for py3, since you can install python for a user without admin rights?) This could also be resolved by calling `GetProcAddress()` on the symbol and dereferencing it, but using the environment variable is consistent with the *.bat file since fc8a5c9ecee0. (The environment variable persists after the interpreter is initialized.) Far more concerning is somehow I've gotten my system into a state where setting the flag causes any output to the pager to be lost (as if it wasn't set at all) in MSYS, cmd.exe, WSL, and PowerShell using py3.9.0, but the environment variable works properly. I'm sure this flag worked on some versions of py3, so I'm not sure what's going on here. This is might be related to init config related changes in 3.8[1], since it works with 3.7.8, but fails with 3.8.1. Somebody who understands encoding issues better than I do should give some thought to if we need to make some changes to our encoding strategy on Windows with py3. With or without the flag/envvar, there is proper output if the command is directly paged by piping to `more.com` (in any environment) or `less` (in MSYS and WSL), or if paging is disabled with `--pager=no`. Legacy mode is required though when Mercurial decides to spin up a pager. [1] https://bugs.python.org/issue41941 Differential Revision: https://phab.mercurial-scm.org/D10756
Thu, 20 May 2021 19:59:03 -0400 tests: partially fix test-transaction-rollback-on-revlog-split.t on Windows
Matt Harbison <matt_harbison@yahoo.com> [Thu, 20 May 2021 19:59:03 -0400] rev 47325
tests: partially fix test-transaction-rollback-on-revlog-split.t on Windows For whatever reason, the extra space causes different output on Windows: $ printf '% 20d' '1' | xxd - 0000000: 2020 2020 2020 2020 2020 2020 2020 2020 0000010: 2020 2020 31 1 vs WSL: /mnt/c/Users/Matt/hg/tests$ printf '% 20d' '1' | xxd - 00000000: 2020 2020 2020 2020 2020 2020 2020 2020 00000010: 2020 2031 Without the space, they both agree the last word is 2031. There are other failures on Windows that I don't understand that are introduced by 46b828b85eb7 and 18415fc918a1. Differential Revision: https://phab.mercurial-scm.org/D10763
Thu, 20 May 2021 19:30:56 -0400 tests: fix test-transaction-safety.t on Windows
Matt Harbison <matt_harbison@yahoo.com> [Thu, 20 May 2021 19:30:56 -0400] rev 47324
tests: fix test-transaction-safety.t on Windows Mostly this is about `C:\dir\sub` style paths being turned into `C:dirsub` by MSYS, and not being about to execute shell scripts in hooks directly. See also a12819559ccb::9e3979a25bfe. Differential Revision: https://phab.mercurial-scm.org/D10762
Wed, 19 May 2021 19:57:55 +0200 docket: move the uid logic in the `revlogutils.docket` module
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 19 May 2021 19:57:55 +0200] rev 47323
docket: move the uid logic in the `revlogutils.docket` module We want to use it for revlog-v2 (& Co), it seems more logical to have the logic lives inside the `docket` file than the `nodemap` file. Differential Revision: https://phab.mercurial-scm.org/D10755
Wed, 19 May 2021 17:12:06 +0200 persistent-nodemap: use the intended uuid size
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 19 May 2021 17:12:06 +0200] rev 47322
persistent-nodemap: use the intended uuid size I overlooked this in the initial implementation. The format already supporting any uuid size so, nothing horrible should happens. Differential Revision: https://phab.mercurial-scm.org/D10754
Wed, 19 May 2021 17:19:46 +0200 persistent-nodemap: add a way to make the picked uid predictable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 19 May 2021 17:19:46 +0200] rev 47321
persistent-nodemap: add a way to make the picked uid predictable This will make the test less volatile and therefore easier to maintain. I am setting this is for the persistent nodemap docket first, but my target is to use similar logic for the revlogv2 (and co) test. For persisent nodemap, they are too many different in how each test variants (with rust, without rust, etc) needs new uid for this be really useful (right now). However it will be directly useful for the revlogv2 logic. Differential Revision: https://phab.mercurial-scm.org/D10753
Thu, 06 May 2021 19:39:19 -0400 run-tests: disable color in 'auto' mode on Windows if stdout is redirected
Matt Harbison <matt_harbison@yahoo.com> [Thu, 06 May 2021 19:39:19 -0400] rev 47320
run-tests: disable color in 'auto' mode on Windows if stdout is redirected Differential Revision: https://phab.mercurial-scm.org/D10761
Thu, 06 May 2021 18:52:08 -0400 run-tests: enable color on Windows
Matt Harbison <matt_harbison@yahoo.com> [Thu, 06 May 2021 18:52:08 -0400] rev 47319
run-tests: enable color on Windows In setting up the CI for Windows on heptapod, I noticed it was complaining about color not being enabled because pygments wasn't installed- even though it was. I had initially disabled color on Windows when using Windows 7, because that didn't understand ANSI color codes and made a mess of the output. But now that it's been unsupported for over a year, I don't think we should care about it either. It's admittedly a hack to depend on Mercurial proper to enable color support in the terminal, but I didn't feel like duplicating that code. I'm under the impression that 3rd party stuff is supposed to use this runner in the Mercurial repo instead of using their own copy, so I think it's safe to assume the Mercurial code is available. If it's not, it won't break anything. Differential Revision: https://phab.mercurial-scm.org/D10760
(0) -30000 -10000 -3000 -1000 -300 -100 -96 +96 +100 +300 +1000 +3000 tip