Mon, 09 Jan 2023 18:04:29 +0100 rust-clippy: tell clippy we care about keeping those `if` clauses separate
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:04:29 +0100] rev 49918
rust-clippy: tell clippy we care about keeping those `if` clauses separate Thses were written this way because it spells out the logic in a more explicit manner.
Mon, 09 Jan 2023 18:03:24 +0100 rust-clippy: factor an `if` with the same duplicated clause
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:03:24 +0100] rev 49917
rust-clippy: factor an `if` with the same duplicated clause Unlike the next changeset, this if is not really made clearer by keeping the cases separate.
Mon, 09 Jan 2023 18:00:56 +0100 rust: fix broken debug assertions
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:00:56 +0100] rev 49916
rust: fix broken debug assertions These were caught by `clippy`. It appears no one uses the debug builds, which is how this wasn't caught before.
Mon, 09 Jan 2023 17:48:54 +0100 rust-narrow: fix loop that never loops
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 17:48:54 +0100] rev 49915
rust-narrow: fix loop that never loops This was caught by `clippy`. I guess the narrow tests leave something to be desired, since this previously only checked the first valid pattern.
Mon, 09 Jan 2023 17:40:03 +0100 rust: run `cargo clippy`
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 17:40:03 +0100] rev 49914
rust: run `cargo clippy` These automatic fixes are good to have because they make the code more idiomatic and less surprising. The transform from `sort` -> `sort_unstable` is questionable, but this is only in a test, so it doesn't matter in our case.
Fri, 06 Jan 2023 18:52:04 +0100 rust: use `logging_timer` instead of `micro_timer`
Raphaël Gomès <rgomes@octobus.net> [Fri, 06 Jan 2023 18:52:04 +0100] rev 49913
rust: use `logging_timer` instead of `micro_timer` I am the author of `micro_timer`. I built it at the time because I couldn't find a crate that was simple to use and flexible to do function timing with. Turns out I just couldn't find it because crates.io's search isn't all that great, or maybe I didn't look hard enough. `logging_timer` is better in every way: - supports changing the logging level - supports start and end logging - supports intermediary messages - supports inline macros - supports formatting the output - better IDE/tree-sitter integration thanks to a more robust proc macro I also changed all uses to one-liners, so it's easier to copy-paste.
Thu, 12 Jan 2023 16:15:51 +0000 pathauditor: make _checkfs_exists a static method
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 12 Jan 2023 16:15:51 +0000] rev 49912
pathauditor: make _checkfs_exists a static method This fixes the bug detected by pytype where the auditor used in vfs.py may be a no-op auditor (vfs.py, line 398), which doesn't have the _checkfs_exists method.
Thu, 12 Jan 2023 13:14:00 +0000 merge: add mergeresult.mapaction to improve speed
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 12 Jan 2023 13:14:00 +0000] rev 49911
merge: add mergeresult.mapaction to improve speed As a part of [hg update] we convert all [ACTION_CREATED] merge results into [ACTION_GET] actions, and that's slightly inefficient because every insertion pays the full cost of maintaining the [mergeresult] data structure up to date. This commit adds a function [mapaction], which is faster. (saves around 0.3s on a large update involving ~400k files)
Wed, 04 Jan 2023 19:30:47 +0000 merge: avoid dereferencing repo fields repeatedly
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 19:30:47 +0000] rev 49910
merge: avoid dereferencing repo fields repeatedly
Fri, 06 Jan 2023 18:09:19 +0000 merge: skip syntactic path checks in [_checkunknownfile]
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 18:09:19 +0000] rev 49909
merge: skip syntactic path checks in [_checkunknownfile] We don't need to check the paths syntactically, since they are coming from diffing the revisions, so hopefully already checked on the way in. We still need to check what's on the filesystem, to avoid traversing the symlinks or subdirs, which we can't know about statically. Also, we use the directory audit to elide [isfileorlink], this removing ~all lstat calls from hg updates from-empty.
Fri, 06 Jan 2023 16:42:24 +0000 pathutil: use `finddirs_rev_noroot` instead of `parts`
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 16:42:24 +0000] rev 49908
pathutil: use `finddirs_rev_noroot` instead of `parts` The benefit this brings is very tiny, if it's even there, since we still didn't get rid of the [parts] computation. It probably won't be worth it without the subsequent patch that adds one more use of [finddirs_rev_noroot]
Fri, 06 Jan 2023 17:29:42 +0000 pathutil: add the more efficient finddir iterator
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 17:29:42 +0000] rev 49907
pathutil: add the more efficient finddir iterator (to be used in subsequent commits)
Mon, 16 Jan 2023 12:10:20 +0000 typing: import unconditionally
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 16 Jan 2023 12:10:20 +0000] rev 49906
typing: import unconditionally This is needed if we're writing python3 signatures.
Wed, 11 Jan 2023 17:51:04 +0400 tests: check how hgweb handles HEAD requests
Anton Shestakov <av6@dwimlabs.net> [Wed, 11 Jan 2023 17:51:04 +0400] rev 49905
tests: check how hgweb handles HEAD requests This test file is loosely based on test-hgweb.t. HEAD support originally implemented in fda5a4b853ab.
Fri, 13 Jan 2023 17:33:03 +0400 convert: replace repr() by pycompat.byterepr() in cvsps.py (issue6789) stable
Anton Shestakov <av6@dwimlabs.net> [Fri, 13 Jan 2023 17:33:03 +0400] rev 49904
convert: replace repr() by pycompat.byterepr() in cvsps.py (issue6789)
Fri, 13 Jan 2023 00:56:37 +0400 convert: change socket mode from b'r+' to 'rwb' in cvs.py (issue6789) stable
Anton Shestakov <av6@dwimlabs.net> [Fri, 13 Jan 2023 00:56:37 +0400] rev 49903
convert: change socket mode from b'r+' to 'rwb' in cvs.py (issue6789) 'r+' mode used to open sockets for read/write operations, but '+' is not supported in Python 3. We're using bytes with these sockets everywhere, so the mode should have 'b'. But the mode argument has to be str, not bytes.
Thu, 12 Jan 2023 19:59:01 +0400 convert: turn the last str regex into bytes in cvs.py (issue6789) stable
Anton Shestakov <av6@dwimlabs.net> [Thu, 12 Jan 2023 19:59:01 +0400] rev 49902
convert: turn the last str regex into bytes in cvs.py (issue6789) Since root is bytes, the regular expression should also be bytes.
Sun, 08 Jan 2023 16:19:10 +0400 tests: test hg status --all with hgext/git
Anton Shestakov <av6@dwimlabs.net> [Sun, 08 Jan 2023 16:19:10 +0400] rev 49901
tests: test hg status --all with hgext/git There's a TODO item in git/dirstate.py about obtaining clean files in a more straightforward way, let's first test that status can and does show clean files at all.
Fri, 06 Jan 2023 17:51:55 +0400 tests: aborting on unknown revision emits exit code 10 even with hgext/git
Anton Shestakov <av6@dwimlabs.net> [Fri, 06 Jan 2023 17:51:55 +0400] rev 49900
tests: aborting on unknown revision emits exit code 10 even with hgext/git
Fri, 06 Jan 2023 15:17:14 +0000 worker: avoid reading 1 byte at a time from the OS pipe
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 15:17:14 +0000] rev 49899
worker: avoid reading 1 byte at a time from the OS pipe Apparently `pickle.load` does a lot of small reads, many of them literally 1-byte, so it benefits greatly from buffering. This change enables the buffering, at the cost of more complicated interaction with the `selector` API. On one repository with ~400k files this reduces the time by about ~30s, from ~60 to ~30s. The difference is so large because the actual updating work is parallellized, while these small reads are bottlenecking the central hg process.
Tue, 10 Jan 2023 12:55:49 -0500 diffutil: rewrite an ersatz ternary operator for building diffopts.text
Matt Harbison <matt_harbison@yahoo.com> [Tue, 10 Jan 2023 12:55:49 -0500] rev 49898
diffutil: rewrite an ersatz ternary operator for building diffopts.text Pytype tends to get confused by these, but the real problem here is that if the caller passes `opts={}` as TortoiseHg has been doing, that is set as the value for `diffopts.text` when in reality it expects a boolean. When `None` is passed explicitly, the default value in `mdiff.defaultopts` is assigned.
Mon, 09 Jan 2023 14:34:19 -0500 mdiff: add a __str__ method to diffopts
Matt Harbison <matt_harbison@yahoo.com> [Mon, 09 Jan 2023 14:34:19 -0500] rev 49897
mdiff: add a __str__ method to diffopts This makes it easier to debug by just formatting the object into `%s` to see the members and state, instead of the class and memory address.
Fri, 06 Jan 2023 11:38:13 -0500 debugshell: allow TortoiseHg builds to exit with the usual `quit()` command
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 11:38:13 -0500] rev 49896
debugshell: allow TortoiseHg builds to exit with the usual `quit()` command I've long been annoyed that `quit()` only randomly worked to exit the interpreter. When that happens, Ctrl+C doesn't work either (it simply prints "KeyboardInterrupt"), so then you have to `import sys` and `sys.exit()`. But it turns out that the behavior isn't random and it depended on which `hg.exe` was picked up on PATH first, because py2exe disables site initialization. I wasn't able to persuade the maintainer to allow an opt-in to initialization[1], but this works around it so that the behavior is now consistent however `hg.exe` is built. TortoiseHg 6.3.3 will be the first build that includes the site package, so handle the ImportError. [1] https://github.com/py2exe/py2exe/issues/154
Wed, 11 Jan 2023 19:53:58 +0000 doc: add a few comments
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 11 Jan 2023 19:53:58 +0000] rev 49895
doc: add a few comments
Thu, 05 Jan 2023 17:15:03 +0000 rhg: implement checkexec to support weird filesystems
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 05 Jan 2023 17:15:03 +0000] rev 49894
rhg: implement checkexec to support weird filesystems In particular, some of our repos are stored on a fileserver that simulates POSIX permissions poorly, in such a way that prevents the removal of execute permission. This causes rhg show a spurious unclean status, even though python hg reports the repo as clean. We fix this by making rhg implement the ~same checkexec logic that python hg does.
Fri, 06 Jan 2023 12:16:04 -0500 convert: stop passing str to the dateutil API in darcs stable
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 12:16:04 -0500] rev 49893
convert: stop passing str to the dateutil API in darcs I'm sure there's a bunch more stuff in here that's broken, but this was flagged by pytype.
Thu, 05 Jan 2023 19:47:35 -0500 sparse: fix a py2 based usage of `map()` stable
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 19:47:35 -0500] rev 49892
sparse: fix a py2 based usage of `map()` In a local pytype run, this fixes: File "/mnt/c/Users/Matt/hg/hgext/sparse.py", line 386, in debugsparse: unsupported operand type(s) for item retrieval: 'fcounts: Iterator[int]' and '0: int' [unsupported-operands] No attribute '__getitem__' on 'fcounts: Iterator[int]' File "/mnt/c/Users/Matt/hg/hgext/sparse.py", line 387, in debugsparse: unsupported operand type(s) for item retrieval: 'fcounts: Iterator[int]' and '1: int' [unsupported-operands] No attribute '__getitem__' on 'fcounts: Iterator[int]' File "/mnt/c/Users/Matt/hg/hgext/sparse.py", line 388, in debugsparse: unsupported operand type(s) for item retrieval: 'fcounts: Iterator[int]' and '2: int' [unsupported-operands] No attribute '__getitem__' on 'fcounts: Iterator[int]'
Thu, 05 Jan 2023 17:38:14 -0500 histedit: byteify the help for the multifold action stable
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:38:14 -0500] rev 49891
histedit: byteify the help for the multifold action While there's some allowance for str in `_()`, it's commented to be for "goofy unicode docstrings in test", so no idea how well that works, but it should at least come back as bytes. With HGPLAIN, however, the str isn't touched and is returned as-is, so this seems like a real bug.
Wed, 11 Jan 2023 16:16:06 +0000 typing: use python3-style type annotation
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 11 Jan 2023 16:16:06 +0000] rev 49890
typing: use python3-style type annotation
Wed, 04 Jan 2023 17:14:33 +0000 merge: cache the fs checks made during [_checkunknownfiles]
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 17:14:33 +0000] rev 49889
merge: cache the fs checks made during [_checkunknownfiles] this ~halves the number of lstat calls made when updating from rev(-1) to a revision with lots of files
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 tip