Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 16:27:31 +0000] rev 49964
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 49963
pathutil: slightly faster path audit in the common case
Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 06 Jan 2023 16:01:31 +0000] rev 49962
debug: add a config to abort update early
This is useful to benchmark the parts of [hg update] that come
before the parallel worker.
Anton Shestakov <av6@dwimlabs.net> [Wed, 11 Jan 2023 16:51:37 +0400] rev 49961
dirstate: add missing methods and kwargs to idirstate interface
Anton Shestakov <av6@dwimlabs.net> [Thu, 05 Jan 2023 19:52:00 +0400] rev 49960
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 49959
dirstate: update docstrings in idirstate from the current dirstate
Matt Harbison <matt_harbison@yahoo.com> [Wed, 04 Jan 2023 13:47:10 -0500] rev 49958
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.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 04 Jan 2023 00:20:27 -0500] rev 49957
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 49956
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 49955
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 49954
contrib: drop py2 support from testparseutil.py
Matt Harbison <matt_harbison@yahoo.com> [Tue, 03 Jan 2023 23:49:05 -0500] rev 49953
tests: drop py2 support from `f` utility
Matt Harbison <matt_harbison@yahoo.com> [Tue, 03 Jan 2023 23:47:29 -0500] rev 49952
tests: drop py2 support from test-doctest.py
Matt Harbison <matt_harbison@yahoo.com> [Tue, 03 Jan 2023 23:44:12 -0500] rev 49951
tests: drop py2 support from test-demandimport.py
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 10:59:59 -0500] rev 49950
pytype: add coverage for parts of hgext
There are tons of things to fix here (which have been blacklisted for now), but
this should help prevent further regressions.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 12:16:04 -0500] rev 49949
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> [Fri, 06 Jan 2023 10:56:53 -0500] rev 49948
typing: suppress a couple of attribute-errors in convert
I thought these might be real issues, but they're not.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 00:05:14 -0500] rev 49947
hooklib: force an exception wrapped by errors.Abort to bytestr
Flagged by PyCharm and pytype.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 00:04:46 -0500] rev 49946
notify: force an exception wrapped by errors.Abort to bytestr
Flagged by PyCharm and pytype.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 19:53:02 -0500] rev 49945
typing: disable a bogus attribute-error warning in phabricator
In a local pytype run, this fixes:
File "/mnt/c/Users/Matt/hg/hgext/phabricator.py", line 359, in <lambda>:
No attribute 'items' on bytes [attribute-error]
In Union[Any, bytes]
Called from (traceback):
line 363, in process
The `bytes` case takes the previous `if` branch though.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 19:47:35 -0500] rev 49944
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 19:42:45 -0500] rev 49943
typing: adjust `mercurial.util.iterlines()` to accept any `Iterable`
In a local pytype run on the extensions, this fixes:
File "/mnt/c/Users/Matt/hg/hgext/phabricator.py", line 788, in maketext:
Function mercurial.util.iterlines was called with the wrong arguments [wrong-arg-types]
Expected: (iterator: Iterator[bytes])
Actually passed: (iterator: list)
Attributes of protocol Iterator[bytes] are not implemented on list: __next__
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:45:25 -0500] rev 49942
typing: disable an attribute-error warning in the journal extension
The code is complicated enough that pytype doesn't realize that `name` can't be
`None` if it is evaluated here.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Jan 2023 12:20:09 -0500] rev 49941
remotefilelog: byteify the message for a few StorageErrors
Flagged by pytype locally.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:38:14 -0500] rev 49940
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.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:31:11 -0500] rev 49939
typing: disable a few incorrect warnings in pywatchman
The module-attr warnings are for things that only exist on Windows, and the
wrong-keyword-args warning is due to a special case for a specific constructor.
Both of these are properly conditionalized.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:28:33 -0500] rev 49938
watchman: refactor transport connecting to unconfuse pytype
Pytype sees `self.proc` as potentially `None` here, even though it's set by the
`_connect()` logic. Instead of asserting, simply use the process returned by
that method (which it sets into `self.proc` before returning, so there's no
functional change here).
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:24:11 -0500] rev 49937
watchman: refactor `ctypes.windll.kernel32` references to a local variable
This is flagged by pytype as an attribute-error, and it's easier to disable that
in a single place.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:21:09 -0500] rev 49936
typing: disable [unsupported-operands] warning in the largefiles outgoing hook
For some reason, pytype thinks `toupload` is a set:
No attribute '__setitem__' on Set[nothing]
(It actually is a set in the subsequent `else` branch, but I'm not interested in
trying to rewrite this to be consistent.)
Matt Harbison <matt_harbison@yahoo.com> [Thu, 05 Jan 2023 17:15:27 -0500] rev 49935
typing: add some assertions that a variable isn't None
In the case of blackbox, there's a default limit if one isn't explicitly
supplied. For the monotone regex, neither group is optional, so a match means
it's not None.