revlog-compression: use zstd by default (if available)
As see in changeset
bb271ec2fbfb, zstd is 20% to 50% faster for reading and
writing.
Use take advantage of the new config behavior to try zstd by default, falling
back to zlib is zstd is not available on that plateform.
Differential Revision: https://phab.mercurial-scm.org/D10326
rhg: make rhg recognise it supports zstd compression for revlogs
It already did, but was not aware of it.
Differential Revision: https://phab.mercurial-scm.org/D10324
match: convert O(n) to O(log n) in exactmatcher.visitchildrenset
When using narrow, during rebase this is called (at least) once per directory in
the set of files in the commit being rebased. Every time it's called, we did the
set arithmetic (now extracted and cached), which was probably pretty cheap but
not necessary to repeat each time, looped over every item in the matcher and
kept things that started with the directory we were querying.
With very large narrowspecs, and a commit that touched a file in a large number
of directories, this was slow. In a pathological repo, the rebase of a single
commit (that touched over 17k files, I believe in approximately as many
directories) with a narrowspec that had >32k entries took 8,246s of profiled
time, with 5,007s of that spent in visitchildrenset (transitively). With this
change, the time spent in visitchildrenset is less than 34s (which is where my
profile cut off). Most of the remaining time was network access due to our
custom remotefilelog-based setup not properly prefetching.
Differential Revision: https://phab.mercurial-scm.org/D10294
exthelper: improve docs to indicate what module vars are needed
I recently tried creating an extension "from scratch" using exthelper, and it
wasn't obvious that you needed these. I believe that a careful reading of one of
the comments would tell you that they were required, but it's easy to miss and
having the examples be "complete" is helpful.
Differential Revision: https://phab.mercurial-scm.org/D10295
tests: restore the ability to run `black` on Windows
The hghave test for black silently stopped working with the change in
08fd76a553c9. This was the output of what it was hitting when run in the test
environment:
Traceback (most recent call last):\r (esc)
File "c:\\users\\matt\\appdata\\local\\programs\\python\\python39\\lib\\runpy.py", line 197, in _run_module_as_main\r (esc)
return _run_code(code, main_globals, None,\r (esc)
File "c:\\users\\matt\\appdata\\local\\programs\\python\\python39\\lib\\runpy.py", line 87, in _run_code\r (esc)
exec(code, run_globals)\r (esc)
File "c:\\Users\\Matt\\AppData\\Roaming\\Python\\Python39\\Scripts\\black.exe\\__main__.py", line 4, in <module>\r (esc)
File "C:\\Users\\Matt\\AppData\\Roaming\\Python\\Python39\\site-packages\\black\\__init__.py", line 70, in <module>\r (esc)
CACHE_DIR = Path(user_cache_dir("black", version=__version__))\r (esc)
File "C:\\Users\\Matt\\AppData\\Roaming\\Python\\Python39\\site-packages\\appdirs.py", line 293, in user_cache_dir\r (esc)
path = os.path.normpath(_get_win_folder("CSIDL_LOCAL_APPDATA"))\r (esc)
File "C:\\Users\\Matt\\AppData\\Roaming\\Python\\Python39\\site-packages\\appdirs.py", line 481, in _get_win_folder_with_pywin32\r (esc)
dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0)\r (esc)
pywintypes.com_error: (-
2147024893, '$ENOTDIR$.', None, None)\r (esc)
[1]
Differential Revision: https://phab.mercurial-scm.org/D10310
setup: copy python3.dll next to hg.exe when building on Windows for hgext.git
I thought I took care of this already, but it must have been that I just
manually copied the file over locally when debugging why the pygit2 library
wasn't loading. The problem with that is what was copied over was from py38,
and then running a py39 build hard crashed when the extension was loaded.
Differential Revision: https://phab.mercurial-scm.org/D10301
tests: stablize test-hook.t on Windows
Apparently, hooks can't run `echo` directly, even from MSYS.
Differential Revision: https://phab.mercurial-scm.org/D10300
tests: handle Windows file separator differences in test-config.t
Differential Revision: https://phab.mercurial-scm.org/D10299