Thu, 26 Jan 2023 00:23:07 +0100 filemerge: add union-other-first as internal merge tool
Cédric Krier <ced@b2ck.com> [Thu, 26 Jan 2023 00:23:07 +0100] rev 49956
filemerge: add union-other-first as internal merge tool See inline documentation for details.
Mon, 09 Jan 2023 17:48:54 +0100 rust-narrow: fix loop that never loops stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 17:48:54 +0100] rev 49955
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.
Fri, 13 Jan 2023 00:07:07 +0100 rust: use `peek_mut` from the standard lib now that it's stable
Raphaël Gomès <rgomes@octobus.net> [Fri, 13 Jan 2023 00:07:07 +0100] rev 49954
rust: use `peek_mut` from the standard lib now that it's stable Just a little cleanup of a TODO found along the way.
Wed, 25 Jan 2023 19:37:06 +0400 hghave: refactor checks for pygments versions using checkvers() stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 25 Jan 2023 19:37:06 +0400] rev 49953
hghave: refactor checks for pygments versions using checkvers()
Wed, 25 Jan 2023 19:27:50 +0400 hghave: make different has_pyoxidizer functions have different names stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 25 Jan 2023 19:27:50 +0400] rev 49952
hghave: make different has_pyoxidizer functions have different names There are 3 of them, and them all having the same name triggered code checkers.
Wed, 25 Jan 2023 19:25:42 +0400 tests: pygments 2.14+ highlight whitespace in python code stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 25 Jan 2023 19:25:42 +0400] rev 49951
tests: pygments 2.14+ highlight whitespace in python code
Wed, 25 Jan 2023 18:54:17 +0400 tests: make sure pygments can detect python script without extension stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 25 Jan 2023 18:54:17 +0400] rev 49950
tests: make sure pygments can detect python script without extension This .t file was failing for me when running run-tests.py with python3.11. Then I tried to run it with python3.10 and it failed anyway, even though it's the default python3 interpreter. But with `python3 ./run-tests.py` it worked fine. And this is what I found while looking at the way pygments lexer checks if a file without extension is likely to be a python script: shebang_matches(text, r'pythonw?(3(\.\d)?)?') Take guess why it doesn't work for python >= 3.10. To work around this issue, we can simply hardcode an "easier" shebang for pygments. This path to python interpreter obviously doesn't need to be accurate, since we're not running this script.
Wed, 25 Jan 2023 18:45:38 +0100 clippy: actually fail if there are any warnings
Raphaël Gomès <rgomes@octobus.net> [Wed, 25 Jan 2023 18:45:38 +0100] rev 49949
clippy: actually fail if there are any warnings So far, only errors would trip the CI, this makes it so all warnings are elevated to errors, making it a CI fail if any warnings are present. This was the intended behavior, I just missed this when adding clippy.
Wed, 25 Jan 2023 18:44:09 +0100 rust-clippy: fix warning about nested ifs
Raphaël Gomès <rgomes@octobus.net> [Wed, 25 Jan 2023 18:44:09 +0100] rev 49948
rust-clippy: fix warning about nested ifs
Wed, 25 Jan 2023 17:52:00 +0400 convert: brz 3.3.0 moved NoSuchFile exception to breezy.transport stable
Anton Shestakov <av6@dwimlabs.net> [Wed, 25 Jan 2023 17:52:00 +0400] rev 49947
convert: brz 3.3.0 moved NoSuchFile exception to breezy.transport
Tue, 06 Dec 2022 15:11:51 +0100 revset: the `random` sort should not depend on sys.maxsize (issue6770) stable
Julien Cristau <jcristau@mozilla.com> [Tue, 06 Dec 2022 15:11:51 +0100] rev 49946
revset: the `random` sort should not depend on sys.maxsize (issue6770)
Mon, 23 Jan 2023 14:04:17 +0100 contrib: adjust heptapod CI flavor sizes stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 23 Jan 2023 14:04:17 +0100] rev 49945
contrib: adjust heptapod CI flavor sizes Our CI currently runs on a number of different runners, some of which are run by Clever Cloud. By setting this environement variable, we're asking for a smaller size runner for our smaller jobs, which puts less load on the Clever Cloud infrastructure, while not affecting our overall pipeline times.
Thu, 19 Jan 2023 11:12:20 -0500 debugshell: allow commands to be specified as a CLI argument
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Thu, 19 Jan 2023 11:12:20 -0500] rev 49944
debugshell: allow commands to be specified as a CLI argument Add a `--command` option to `hg debugshell` that allows the user to pass in Python code to evaluate directly from the command line. This was inspired by the `--command` option present in Facebook's Sapling fork of Mercurial, which in turn was inspired by the `-c` option of the Python interpreter itself. It is particularly useful for writing tests, especially for getting visibility into things that otherwise aren't exposed via debug commands.
Thu, 12 Jan 2023 19:56:59 +0400 resourceutil: start using importlib.resources.files() when possible stable
Anton Shestakov <av6@dwimlabs.net> [Thu, 12 Jan 2023 19:56:59 +0400] rev 49943
resourceutil: start using importlib.resources.files() when possible This avoids DeprecationWarnings related to our use of resources.open_binary() on Python 3.11.
Tue, 10 Jan 2023 17:35:53 +0400 tests: fix a typo in test-demandimport.t stable
Anton Shestakov <av6@dwimlabs.net> [Tue, 10 Jan 2023 17:35:53 +0400] rev 49942
tests: fix a typo in test-demandimport.t I guess we figured out why it wasn't lazy.
Tue, 10 Jan 2023 17:23:13 +0400 tests: os module is frozen in Python 3.11 (issue6786) stable
Anton Shestakov <av6@dwimlabs.net> [Tue, 10 Jan 2023 17:23:13 +0400] rev 49941
tests: os module is frozen in Python 3.11 (issue6786)
Tue, 10 Jan 2023 11:40:19 +0100 heptapod-ci: add `clippy` to the CI
Raphaël Gomès <rgomes@octobus.net> [Tue, 10 Jan 2023 11:40:19 +0100] rev 49940
heptapod-ci: add `clippy` to the CI This linter mostly makes our code more idiomatic, less surprising, has good suggestions and catches bugs. It's widely used in the Rust community and now part of the default toolchain when using `rustup`.
Tue, 10 Jan 2023 11:39:53 +0100 makefile: add `cargo clippy` to tests if cargo is available
Raphaël Gomès <rgomes@octobus.net> [Tue, 10 Jan 2023 11:39:53 +0100] rev 49939
makefile: add `cargo clippy` to tests if cargo is available This linter mostly makes our code more idiomatic, less surprising, has good suggestions and catches bugs. It's widely used in the Rust community and now part of the default toolchain when using `rustup`.
Tue, 10 Jan 2023 11:25:24 +0100 rust-tests: run `cargo` tests inside the `rust` folder
Raphaël Gomès <rgomes@octobus.net> [Tue, 10 Jan 2023 11:25:24 +0100] rev 49938
rust-tests: run `cargo` tests inside the `rust` folder There is no reason to only run inside the `rust/hg-cpython` folder, even if the `cargo test --all` behavior ends up being the same.
Tue, 10 Jan 2023 11:20:54 +0100 rust-clippy: merge "revlog" module definition and struct implementation
Raphaël Gomès <rgomes@octobus.net> [Tue, 10 Jan 2023 11:20:54 +0100] rev 49937
rust-clippy: merge "revlog" module definition and struct implementation Module inception is confusing when looking for code and almost never the right choice.
Tue, 10 Jan 2023 10:57:15 +0100 rust-clippy: merge "config" module definition and struct implementation
Raphaël Gomès <rgomes@octobus.net> [Tue, 10 Jan 2023 10:57:15 +0100] rev 49936
rust-clippy: merge "config" module definition and struct implementation Module inception is confusing when looking for code and almost never the right choice.
Tue, 10 Jan 2023 10:45:38 +0100 rust-clippy: upgrade `bytes-cast` dependency
Raphaël Gomès <rgomes@octobus.net> [Tue, 10 Jan 2023 10:45:38 +0100] rev 49935
rust-clippy: upgrade `bytes-cast` dependency I released a new version of `bytes-cast` to get rid of the clippy warning, and bump to edition 2021, so let's use it.
Tue, 10 Jan 2023 10:41:52 +0100 rust-clippy: remove redundant suffix from enum
Raphaël Gomès <rgomes@octobus.net> [Tue, 10 Jan 2023 10:41:52 +0100] rev 49934
rust-clippy: remove redundant suffix from enum Same as last time, this makes the code clearer in this instance.
Mon, 09 Jan 2023 19:37:05 +0100 rust-clippy: fix remaining warnings in `hg-cpython`
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 19:37:05 +0100] rev 49933
rust-clippy: fix remaining warnings in `hg-cpython`
Mon, 09 Jan 2023 19:36:41 +0100 rust-clippy: disable some lints crate-wide for `hg-cpython`
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 19:36:41 +0100] rev 49932
rust-clippy: disable some lints crate-wide for `hg-cpython` `rust-cpython` creates some pretty funky code that also needs to be compatible with pretty old Rust. This makes clippy quite useless in `hg-cpython` unless you disable the lints that are always triggered by `py_class!` and related. Maybe `clippy` will allow one day to exclude a dependency from its linting, but this seems quite unlikely, so this is the best we've got at the moment.
Mon, 09 Jan 2023 19:32:35 +0100 rust-clippy: fix remaining warnings in `rhg`
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 19:32:35 +0100] rev 49931
rust-clippy: fix remaining warnings in `rhg` All of these are simple changes that for the most part are clear improvements and the rest are at most equivalent.
Mon, 09 Jan 2023 19:18:43 +0100 rust-clippy: fix most warnings in `hg-core`
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 19:18:43 +0100] rev 49930
rust-clippy: fix most warnings in `hg-core` All of these are simple changes that for the most part are clear improvements and the rest are at most equivalent. The remaining warnings have to be fixed either with a bigger refactor like for the nested "revlog" module, or in the dependency `bytes-cast`, which we own. This will be done sometime in the future.
Mon, 09 Jan 2023 19:14:14 +0100 rust-utils: strip redundant prefix from enum
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 19:14:14 +0100] rev 49929
rust-utils: strip redundant prefix from enum This was highlighted by `clippy`, I think this makes the code cleaner.
Mon, 09 Jan 2023 19:07:44 +0100 rust-filepatterns: don't `Box` subincludes unnecessarily
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 19:07:44 +0100] rev 49928
rust-filepatterns: don't `Box` subincludes unnecessarily This was caught by `clippy`.
Mon, 09 Jan 2023 18:58:18 +0100 rust-nodemap: implement `PartialEq` without allocation
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:58:18 +0100] rev 49927
rust-nodemap: implement `PartialEq` without allocation This was caught by `clippy`. It's probable that this ends up optimized out by the compiler, but let's not rely on that.
Mon, 09 Jan 2023 18:54:57 +0100 rust-clippy: tell `clippy` we don't need to declare a default here
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:54:57 +0100] rev 49926
rust-clippy: tell `clippy` we don't need to declare a default here This is a struct only useful for tests.
Mon, 09 Jan 2023 18:50:29 +0100 rust-clippy: refactor complex type
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:50:29 +0100] rev 49925
rust-clippy: refactor complex type This makes reading the signature a bit less tiring.
Mon, 09 Jan 2023 18:30:42 +0100 rust-clippy: simplify return type of debug function
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:30:42 +0100] rev 49924
rust-clippy: simplify return type of debug function This makes the type a little bit more readable.
Mon, 09 Jan 2023 18:27:53 +0100 rust-clippy: add `is_empty` method to please the `clippy` gods
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:27:53 +0100] rev 49923
rust-clippy: add `is_empty` method to please the `clippy` gods I can see it being useful anyway.
Mon, 09 Jan 2023 18:25:24 +0100 rust: don't use a reference to a `Cow`
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:25:24 +0100] rev 49922
rust: don't use a reference to a `Cow` This was caught by `clippy`.
Mon, 09 Jan 2023 18:22:46 +0100 rust-clippy: reassure `clippy` that 8 arguments is expected
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:22:46 +0100] rev 49921
rust-clippy: reassure `clippy` that 8 arguments is expected This API is a bit verbose, but refactoring it into a struct isn't better in this particular case IMO, and there is a lot of info to pass.
Mon, 09 Jan 2023 18:15:29 +0100 rust-clippy: use `write_all` since we're not expecting a partial write
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:15:29 +0100] rev 49920
rust-clippy: use `write_all` since we're not expecting a partial write Clippy caught this. This is a good lint in general, but here this was not really a bug in this example code.
Mon, 09 Jan 2023 18:09:26 +0100 rust-clippy: tell clippy we want to keep those clauses separate
Raphaël Gomès <rgomes@octobus.net> [Mon, 09 Jan 2023 18:09:26 +0100] rev 49919
rust-clippy: tell clippy we want to keep those clauses separate This makes the cases more explicit, which is wanted in this specific instance.
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.
(0) -30000 -10000 -3000 -1000 -300 -100 -48 +48 +100 +300 +1000 tip