Fri, 04 Nov 2022 17:54:43 -0400 vfs: make the default opener mode binary
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 17:54:43 -0400] rev 49574
vfs: make the default opener mode binary The default was already binary for `abstractvfs`, and the `vfs` implementation adds binary mode if the caller didn't supply it. Therefore, it should be safe for all vfs objects (and I don't think we want text reads anyway).
Wed, 02 Nov 2022 17:30:57 -0400 typing: add basic type hints to vfs.py
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Nov 2022 17:30:57 -0400] rev 49573
typing: add basic type hints to vfs.py Again, there's a lot more that could be done, but this sticks to the obviously correct stuff that is related to primitives or `vfs` objects. Hopefully this helps smoke out more path related bytes vs str issues in TortoiseHg. PyCharm seems smart enough to apply hints from annotated superclass functions, but pytype isn't (according to the *.pyi file generated), so those are annotated too. There was some discussion about changing the default path arg from `None` to `b''` in order to avoid the more verbose `Optional` declarations. This would be more in line with `os.path.join()` (which rejects `None`, but ignores empty strings), and still not change the behavior for callers still passing `None` (because the check is `if path` instead of an explicit check for `None`). But I didn't want to hold this up while discussing that, so this documents what _is_.
Fri, 04 Nov 2022 17:35:44 -0400 util: implement `writelines()` on atomictempfile
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 17:35:44 -0400] rev 49572
util: implement `writelines()` on atomictempfile With typehints on the vfs objects, pytype will flag this: FAILED: /mnt/c/Users/Matt/hg/.pytype/pyi/mercurial/patch.pyi /usr/bin/python3.8 -m pytype.single --imports_info /mnt/c/Users/Matt/hg/.pytype/imports/mercurial.patch.imports --module-name mercurial.patch -V 3.7 -o /mnt/c/Users/Matt/hg/.pytype/pyi/mercurial/patch.pyi --analyze-annotated --nofail --quick /mnt/c/Users/Matt/hg/mercurial/patch.py File "/mnt/c/Users/Matt/hg/mercurial/patch.py", line 535, in writerej: No attribute 'writelines' on mercurial.util.atomictempfile [attribute-error] In Union[ mercurial.util.atomictempfile, mercurial.vfs.checkambigatclosing, mercurial.vfs.delayclosedfile, mercurial.windows.fdproxy, mercurial.windows.mixedfilemodewrapper ] It's not a real problem there (atomictempfile is only created by passing different args), but it's reasonable for this to implement the function and behave like a normal file. There are other functions missing that can be added if/when needed.
Wed, 02 Nov 2022 16:43:01 -0400 typing: add basic type hints to localrepo.py
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Nov 2022 16:43:01 -0400] rev 49571
typing: add basic type hints to localrepo.py There's a lot more that could be done, but this sticks to the obviously correct stuff that is either related to existing imports or primitives. Hopefully this helps smoke out more path related bytes vs str issues in TortoiseHg. I'm avoiding the interfaces for now, because they seem to confuse pytype and/or PyCharm. It might be worth typing the return of `makelocalrepository` to `localrepository`, but that leaks an implementation detail, so that can be revisited later.
Sat, 05 Nov 2022 00:38:02 -0400 check-code: drop the check for whitespace around named parameters
Matt Harbison <matt_harbison@yahoo.com> [Sat, 05 Nov 2022 00:38:02 -0400] rev 49570
check-code: drop the check for whitespace around named parameters This check flags py3 annotations of named parameters, because `black` adds spaces around the assignment in this case. Since the chosen formatter has opinions (and pylint also wants the space in the case of annotations), drop the check so we can use py3 annotations.
Thu, 03 Nov 2022 16:30:35 +0100 rhg: add a config option to fall back immediately stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 16:30:35 +0100] rev 49569
rhg: add a config option to fall back immediately This is useful for debugging the behavior of the "default" `hg` in tests without having to manually substitute the fallback path.
Wed, 19 Oct 2022 12:38:06 +0200 rust-status: query fs traversal metadata lazily
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Oct 2022 12:38:06 +0200] rev 49568
rust-status: query fs traversal metadata lazily Currently, any time the status algorithm needs to read a directory from the filesystem (because the stat-only optimization is not available), it also stats each directory entry eagerly. Stat'ing the entries is only needed in a few cases (like when checking the mtime of a directory for caching): this patch creates a wrapper struct `DirEntry` that only stats the directory entry it represents when needed. Excerpt of an `strace` before this change on Mozilla Central: ``` openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3 newfstatat(3, "", {st_mode=S_IFDIR|0755, st_size=3540, ...}, AT_EMPTY_PATH) = 0 getdents64(3, 0x55dc970bd440 /* 139 entries */, 32768) = 5072 statx(3, ".hg", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=772, ...}) = 0 [... 135 other successful `statx` calls] getdents64(3, 0x55dc970bd440 /* 0 entries */, 32768) = 0 close(3) = 0 ``` After this change: ``` openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3 newfstatat(3, "", {st_mode=S_IFDIR|0755, st_size=3540, ...}, AT_EMPTY_PATH) = 0 getdents64(3, 0x561567c10190 /* 139 entries */, 32768) = 5072 getdents64(3, 0x561567c10190 /* 0 entries */, 32768) = 0 close(3) = 0 ```
Wed, 19 Oct 2022 14:46:19 +0200 rust-status: make `DirEntry` attributes clearer
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Oct 2022 14:46:19 +0200] rev 49567
rust-status: make `DirEntry` attributes clearer
Thu, 03 Nov 2022 15:57:37 +0100 rhg: stop shadowing `exit` function stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 15:57:37 +0100] rev 49566
rhg: stop shadowing `exit` function This will be useful for the next patch which needs it.
Thu, 03 Nov 2022 15:43:04 +0100 config: add alias from `hg help rhg` to `hg help rust` stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 15:43:04 +0100] rev 49565
config: add alias from `hg help rhg` to `hg help rust` This will make using `rhg` more user-friendly and features more discoverable.
Thu, 03 Nov 2022 15:42:33 +0100 rhg: add `config.rhg` helptext stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 15:42:33 +0100] rev 49564
rhg: add `config.rhg` helptext This will make using `rhg` more user-friendly and features more discoverable.
Thu, 03 Nov 2022 15:44:54 +0100 config: fix indentation of some`share-safe` options stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 15:44:54 +0100] rev 49563
config: fix indentation of some`share-safe` options This makes the output much more readable.
Sun, 16 Oct 2022 04:48:21 +0200 perf-unbundle: do a quick and dirty fix to make it run on more commit stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 16 Oct 2022 04:48:21 +0200] rev 49562
perf-unbundle: do a quick and dirty fix to make it run on more commit Without this change, the perf commands fails within the f67741e8264b::18415fc918a1 range (boundary excluded). Check inline comment for details. With this fix, the command is able to run on this range, with a slightly different behavior (as no revset is "uninlined"). However this is still much better than not being able to run anything in this range. Especially because that range do see some performance regression for unbundle.
Wed, 19 Oct 2022 01:54:04 +0200 perf-unbundle: pre-indent the main block in per::unbundle stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 19 Oct 2022 01:54:04 +0200] rev 49561
perf-unbundle: pre-indent the main block in per::unbundle This makes the next changeset clearer.
Wed, 19 Oct 2022 16:23:42 -0400 shelve: handle empty parents and nodestoremove in shelvedstate (issue6748) stable
Jason R. Coombs <jaraco@jaraco.com> [Wed, 19 Oct 2022 16:23:42 -0400] rev 49560
shelve: handle empty parents and nodestoremove in shelvedstate (issue6748)
Thu, 03 Nov 2022 14:58:58 +0100 rhg: fallback when encountering ellipsis revisions stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 14:58:58 +0100] rev 49559
rhg: fallback when encountering ellipsis revisions Ellipsis revisions are still experimental and buggy in non-trivial histories. We currently have no plans to improve this situation nor to add support for ellipsis revisions in `rhg`. Falling back should be done carefully (since we may have already done some work that is visible to the user), but in this case it's highly unlikely that we're doing anything useful with a repo with ellipsis revisions, so this should be strictly better, also since the error message is more explicit.
Wed, 02 Nov 2022 12:05:34 +0100 dirstate-v2: hash the source of the ignore patterns as well stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Nov 2022 12:05:34 +0100] rev 49558
dirstate-v2: hash the source of the ignore patterns as well Fixes the test introduced in the last changeset. This caused the hash to change, which means that the check in the test had to be adapted. Since this hash is only done as a caching mechanism, invalidation does not pose any backwards compatibility issues.
Wed, 02 Nov 2022 15:24:39 +0100 dirstate-v2: add test that shows a collision in ignore patterns hash stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Nov 2022 15:24:39 +0100] rev 49557
dirstate-v2: add test that shows a collision in ignore patterns hash This hash is used for optimizing dirstate `status`. We demonstrate that the hash is incorrectly ignoring the changes to the semantics of the ignore files just because the contents (but not their source) haven't changed. This is fixed in the next changeset.
Thu, 03 Nov 2022 12:08:02 +0100 testlib: add `--raw-sha1` option to `f` stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Nov 2022 12:08:02 +0100] rev 49556
testlib: add `--raw-sha1` option to `f` This will be used in the patch fixing the ignore hash collision in dirstate-v2 to check the behavior of the new hashing function.
Wed, 19 Oct 2022 16:28:41 +0200 rust-status: save new dircache even if just invalidated stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Oct 2022 16:28:41 +0200] rev 49555
rust-status: save new dircache even if just invalidated There was a functional race between invalidating the cache (not acted upon until the end of the status algorithm) and populating the new cache (which relies upon an up-to-date version of the cache). We simply inform the cache populating function that we've just invalidated the cache for this particular directory since the information is present in the same scope.
Wed, 19 Oct 2022 15:11:05 +0200 rust-status: fix typos and add docstrings to dircache related fields stable
Raphaël Gomès <rgomes@octobus.net> [Wed, 19 Oct 2022 15:11:05 +0200] rev 49554
rust-status: fix typos and add docstrings to dircache related fields
Thu, 22 Sep 2022 15:34:27 -0400 rhg: show a bug where repeated [hg status] is needed to cache everything stable
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 22 Sep 2022 15:34:27 -0400] rev 49553
rhg: show a bug where repeated [hg status] is needed to cache everything
Fri, 04 Nov 2022 16:15:12 -0400 upgrade: no longer keep all revlogs in memory at any point stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 04 Nov 2022 16:15:12 -0400] rev 49552
upgrade: no longer keep all revlogs in memory at any point Keeping all object open is unsustainable, so we will open them on demand. This mean opening them multiple times, but this is a lesser evil. Each revlog consume a small amount of memory (index content, associated nodemap, etc). While there are few "big" revlog, the sheer amount of small filelog can become a significant issue memory wise, consuming multiple GB of memory. If you combines this extra usage with the use of multiprocessing, this usage can quickly get out of control. This can effectively block the upgrade of larger repository. This changeset fixes this issue.
Wed, 02 Nov 2022 14:23:09 -0400 demandimport: convert ignored modules from bytes -> str in extensions stable
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Nov 2022 14:23:09 -0400] rev 49551
demandimport: convert ignored modules from bytes -> str in extensions The default list of ignored modules are str, and test for bypassing the lazy import is `module.__name__ in ignores`, so these were effectively NOT ignored. Most of these date back to the grand byteification in 687b865b95ad, with some subsequent additions that followed the existing example. I have no idea if these modules in fact need to bypass lazy importing, but at least it follows the intent of the code.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 +1000 tip