Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Jan 2023 15:19:39 +0100] rev 49964
dirstate: rename `@requires_no_parents_change` too
This match the rename of the context manager.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Jan 2023 15:17:29 +0100] rev 49963
dirstate: rename `@requires_parents_change` to `@requires_changing_parents`
This match the rename of the context manager.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 12:10:37 +0100] rev 49962
dirstate: write dirstate on successful exit of changing_parents context
This is the first step toward having more sensible and predicatable write
patterns for the dirstate. Having better write/rollback patterns will greatly
reduce and clarify the needs to backup the dirstate.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 19:12:31 +0100] rev 49961
dirstate: rename parentchange to changing_parents
Since the new argument breaks the API anyway, we can rename it to a better name.
The previous name `parentchange` might be seen as something active, a function
that would directly change the parents, however this is just a context manager
to frame the operation that will change the parents and adjust the
dirstate content accordingly.
In addition, the future sister method that will be about changes to tracking and
files would have a hard time fitting in the same naming scheme in a clear way.
The new naming uses a clear prefix will make it more distinct from other
dirstate methods and easier to extend with other similar contexts.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 25 Jan 2023 18:46:20 +0100] rev 49960
dirstate: pass the repo to the `changeparent` method
If we want the context to be responsible for writing (and we want it), we need
to have access to a localrepository object.
So we now requires a localrepository object as an argument to this context
manager.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 10:00:04 +0100] rev 49959
dirstate: warn about non-explicitly rolledback parent-change
Now that the invalidation is dealt with by the context manager itself, we
should no longer need this in the unlocking code. We start with issuing a
warning if this is the case before actually dropping this code later.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Dec 2022 11:39:44 +0100] rev 49958
dirstate: invalidate changes when parent-change fails
When an error occurs during changing parents, we should invalidate all dirstate
modifications and reload the dirstate. This is currently done by a `unlock`
callback on the `wlock`.
To fix this anomaly, we start dealing with the error directly in the context
manager and its potential nesting.
The "hard" part is to make sure that, when the parent-change context are nested,
we and higher level nesting do not continue to use the invalidated dirstate.
We introduce dedicated code to enforce that.
Cédric Krier <ced@b2ck.com> [Sat, 28 Jan 2023 20:08:57 +0100] rev 49957
setup: Ensure target directory exists with building rust extension
When the rust extension is the first to be build, the target directory may not
exist so the copy fails.
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.
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.
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.
Anton Shestakov <av6@dwimlabs.net> [Wed, 25 Jan 2023 19:37:06 +0400] rev 49953
hghave: refactor checks for pygments versions using checkvers()
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.
Anton Shestakov <av6@dwimlabs.net> [Wed, 25 Jan 2023 19:25:42 +0400] rev 49951
tests: pygments 2.14+ highlight whitespace in python code
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.
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.
Raphaël Gomès <rgomes@octobus.net> [Wed, 25 Jan 2023 18:44:09 +0100] rev 49948
rust-clippy: fix warning about nested ifs
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
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)
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.
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.
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.
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.
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)
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`.
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`.
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.
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.
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.
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.
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.
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`
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.
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.
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.
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.
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`.
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.
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.
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.
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.
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.
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`.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 19:30:47 +0000] rev 49910
merge: avoid dereferencing repo fields repeatedly
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.
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]
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)
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.
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.
Anton Shestakov <av6@dwimlabs.net> [Sun, 08 Jan 2023 16:19:10 +0400] rev 49904
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.
Anton Shestakov <av6@dwimlabs.net> [Fri, 06 Jan 2023 17:51:55 +0400] rev 49903
tests: aborting on unknown revision emits exit code 10 even with hgext/git
Anton Shestakov <av6@dwimlabs.net> [Fri, 13 Jan 2023 17:33:03 +0400] rev 49902
convert: replace repr() by pycompat.byterepr() in cvsps.py (
issue6789)
Anton Shestakov <av6@dwimlabs.net> [Fri, 13 Jan 2023 00:56:37 +0400] rev 49901
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.
Anton Shestakov <av6@dwimlabs.net> [Thu, 12 Jan 2023 19:59:01 +0400] rev 49900
convert: turn the last str regex into bytes in cvs.py (
issue6789)
Since root is bytes, the regular expression should also be bytes.
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.
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.
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.
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
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 11 Jan 2023 19:53:58 +0000] rev 49895
doc: add a few comments
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.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 11 Jan 2023 16:16:06 +0000] rev 49893
typing: use python3-style type annotation
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 17:14:33 +0000] rev 49892
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
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 17:03:15 +0000] rev 49891
merge: disable the whole filesystem access loop if [_realfs] is false
This makes it clearer that [auditeddir] is only relevant for
[_realfs] checkers, and makes the non-realfs checkers more performant.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 16:48:32 +0000] rev 49890
merge: short-circuit the _checkfs loop upon getting ENOENT
This reduces the number of [lstat] calls when updating from rev(-1) to
a rev with lots of files by a factor of several: for path foo/bar/baz/quux.txt
without this patch we're lstatting:
foo
foo/bar
foo/bar/baz
foo/bar/baz/quux.txt
and with this patch:
foo
foo/bar/baz/quux.txt
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 19:13:41 +0000] rev 49889
merge: don't pay for pathconflicts if there are none
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 16:27:31 +0000] rev 49888
pathauditor: no need to normcase the paths
The only thing normed paths are used is the key of the caching sets,
so the only change of behavior will be that the checks will be repeated
for paths that differ by case.
If anything, it seems correct for the check to be repeated, in case
that actually affects semantics, but the main reasoning is simplifying
the code and making it a bit faster.
It looks like the code originally comes from commit [
081e795c60e0]:
it looks like that commit tried to get rid of the existing norming,
but presumably did this overly cautiously, preserving it for the
cache keys, even though it was pointless even then.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 04 Jan 2023 18:42:20 +0000] rev 49887
pathutil: slightly faster path audit in the common case
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 16:01:31 +0000] rev 49886
debug: add a config to abort update early
This is useful to benchmark the parts of [hg update] that come
before the parallel worker.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 12:16:04 -0500] rev 49885
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.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 19:47:35 -0500] rev 49884
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]'
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:38:14 -0500] rev 49883
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.
Anton Shestakov <av6@dwimlabs.net> [Wed, 11 Jan 2023 16:51:37 +0400] rev 49882
dirstate: add missing methods and kwargs to idirstate interface
Anton Shestakov <av6@dwimlabs.net> [Thu, 05 Jan 2023 19:52:00 +0400] rev 49881
dirstate: swap pathto() and get_entry() in idirstate
This way the order of methods in dirstate and idirstate classes is the same.
Just to make it easier to use diff tools to compare the two classes.
Anton Shestakov <av6@dwimlabs.net> [Thu, 05 Jan 2023 19:50:33 +0400] rev 49880
dirstate: update docstrings in idirstate from the current dirstate
Matt Harbison <matt_harbison@yahoo.com> [Wed, 04 Jan 2023 13:47:10 -0500] rev 49879
setup: drop legacy osx compiler tuning to enable universal builds
This was triggering deprecation warnings about migrating to `packaging.version`
from `distutils` Version classes with `make local`. But rather than migrate
that code, let's just get rid of some ~10-12 year old workarounds. As a bonus,
the cext libraries that are built are now universal binaries containing x86_64
and arm64 images (at least when built on macOS 11.4 with Xcode 12.5 and the
universal version of Python 3.9.13).
Several things to note here:
- Apple dropped support for 10.15 in Nov 2022, and OS X Lion that is
referenced is 10.7 (unsupported since late 2014)
- `xcode4` was basically always True because of the `>=` check (10.8 used
Xcode 5, and I have Xcode 10.2 on 10.14)
- `xcode51` was always False for modern-ish Xcode, because of the exact
version string matching
- Python 3.8 only supports OS X 10.9+; the Python 3.9.1+ universal installer
is macOS 11+ only, and Python 3.10 drops the x86_64 installer to deliver
only the universal installer.
All of this is to say, the only thing lost by dropping this code on modern Xcode
is that `os.environ['ARCHFLAGS'] = ''` is no longer set. But we probably
shouldn't be setting that anymore, as shown by the universal libraries now being
generated. I was able to `make local` and `python3 run-tests.py --local` with
python 3.9.9, Xcode 10.2, and macOS 10.14.6, and didn't incur any more than the
usual few test errors, so this should still work on some older versions of
macOS.
Anton Shestakov <av6@dwimlabs.net> [Mon, 09 Jan 2023 18:25:31 +0400] rev 49878
tests: optional PEP 657 error location in test-lfs-serve-access.t (
issue6782)
Matt Harbison <matt_harbison@yahoo.com> [Wed, 04 Jan 2023 00:20:27 -0500] rev 49877
tests: simplify `(py3 no-py36 !)` output matching predicates to `(no-py36 !)`
It's all py3 now.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 04 Jan 2023 00:16:52 -0500] rev 49876
tests: drop `(py3 !)` output matching predicates
Presumably these were paired with `(no-py3 !)` at one point, but now they were
unconditionally true.
test-check-code.t required a couple of `(glob)` markers on the changed lines in
test-lfs-serve-access.t, because of the `$LOCALIP` usage on those lines. Not
sure how those lines slipped through the checks previously.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 19 Jul 2022 16:46:37 -0400] rev 49875
run-tests: drop a workaround for python2
The problem is only on python3, but the awkward handling was because python2
didn't have this exception type. I've sporadically seen it running in WSL, but
no clue what it means.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 03 Jan 2023 23:53:44 -0500] rev 49874
contrib: drop py2 support from testparseutil.py
Matt Harbison <matt_harbison@yahoo.com> [Tue, 03 Jan 2023 23:49:05 -0500] rev 49873
tests: drop py2 support from `f` utility
Matt Harbison <matt_harbison@yahoo.com> [Tue, 03 Jan 2023 23:47:29 -0500] rev 49872
tests: drop py2 support from test-doctest.py
Matt Harbison <matt_harbison@yahoo.com> [Tue, 03 Jan 2023 23:44:12 -0500] rev 49871
tests: drop py2 support from test-demandimport.py
Anton Shestakov <av6@dwimlabs.net> [Mon, 09 Jan 2023 18:09:36 +0400] rev 49870
tests: optional PEP 657 error location in test-extension.t (
issue6781)
Anton Shestakov <av6@dwimlabs.net> [Mon, 09 Jan 2023 18:00:07 +0400] rev 49869
tests: filter out PEP 657 error locations in tracebacks (
issue6780)
https://docs.python.org/3/whatsnew/3.11.html#whatsnew311-pep657