Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Apr 2021 19:10:49 +0200] rev 46985
testing: add a `write_file` function
The function is kinda trivial, but having a simple function avoid silly mistake.
Differential Revision: https://phab.mercurial-scm.org/D10477
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Apr 2021 19:10:18 +0200] rev 46984
testing: add a utility function to wait for file create
This is similar to `tests/testlib/wait-on-file`, but for the python code
Differential Revision: https://phab.mercurial-scm.org/D10476
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Apr 2021 19:09:18 +0200] rev 46983
streamclone: check the errors log in tests
Code can be buggy, in that case having error message tend to help.
Differential Revision: https://phab.mercurial-scm.org/D10475
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Apr 2021 00:23:56 -0400] rev 46982
mail: use a context manager when writing to mbox
Differential Revision: https://phab.mercurial-scm.org/D10484
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Apr 2021 21:31:24 -0700] rev 46981
errors: remove unnecessary varargs handling from OutOfBandError
In my recent D10465, I moved some code over from scmutil into
`OutOfBandError.__init__`. The code was written to deal with an
arbitrary number of `message` arguments to the constructor. It turns
out that we only ever pass 0 or 1. Given that, let's simplify it.
Differential Revision: https://phab.mercurial-scm.org/D10483
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Apr 2021 11:10:16 +0200] rev 46980
phab-refresh: use a special comment on the stable branch
Phabricator make it hard to spot the branch information. As a result patch
intended for stable are consistently queued for default.
We add a special command and flashy GIF to try to attract reviewer attention on
the fact patch are intended for stable.
Differential Revision: https://phab.mercurial-scm.org/D10464
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Apr 2021 11:04:11 +0200] rev 46979
phab-refresh: extract the comment in a variable
This make the script more readable and it is about to become more complex.
Differential Revision: https://phab.mercurial-scm.org/D10463
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Apr 2021 16:53:45 -0700] rev 46978
tests: make test-archive.t pass on py3.9 (
issue6504)
Something got stricter at parsing URL query parameters and now the
parameters need to be separated by "&"; ";" is no longer allowed. See
issue6504 for details.
Differential Revision: https://phab.mercurial-scm.org/D10472
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Apr 2021 12:52:23 -0700] rev 46977
errors: raise RemoteError in some places in exchange.py
This is part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan
Differential Revision: https://phab.mercurial-scm.org/D10467
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Apr 2021 09:37:01 -0700] rev 46976
errors: introduce a class for remote errors
Having an exception for remote errors makes it much easier to exit
with the right detailed exit code.
Differential Revision: https://phab.mercurial-scm.org/D10466
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Apr 2021 10:49:15 -0700] rev 46975
errors: make OutOfBandError extend Abort
I'm about to create a new `RemoteError` exception and make
`OutOfBandError` extend it. This patch prepares for that.
Differential Revision: https://phab.mercurial-scm.org/D10465
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Apr 2021 12:22:25 +0200] rev 46974
revlog: replace revlog._io.size with a new revlog.index.entry_size
The `revlogio` class is mostly a relic from the past. Once in charge of the full
revlog related Input/Output code, that class gradually lost responsibilities to
the point where more IO are now done by `revlog.index` objects or revlog objects
themself. I would like to ultimately remove the `revlogio` class, to do so I
start simple with move the "entry size" information on the index. (The index is
already responsible of the binary unpacking, so it knows the size.
Differential Revision: https://phab.mercurial-scm.org/D10309
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 20:32:53 +0200] rev 46973
perf-discovery: use `get_unique_pull_path`
This performance command now use the new API, unless the benchmarked Mercurial
is older.
Differential Revision: https://phab.mercurial-scm.org/D10423
Aay Jay Chan <aayjaychan@itopia.com.hk> [Wed, 14 Apr 2021 00:38:25 +0800] rev 46972
help: clarify when `$HG_URL` and `$HG_SOURCE` are added in hooks
Differential Revision: https://phab.mercurial-scm.org/D10400
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 16 Apr 2021 15:39:00 +0200] rev 46971
nodemap: deal with data mmap error
If the file is too small, the mmapread call would raise a ValueError. We catch
that and ignore nodemap content (as we do without mmap). This make the repository
slightly slower (until the next write) but usable. Unlike the current crash.
Differential Revision: https://phab.mercurial-scm.org/D10458
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 16 Apr 2021 14:59:13 +0200] rev 46970
nodemap: test various corruption scenario for the persistent nodemap
Corruption can happens in the wild, either because some of our code is buggy or
because repository were shared/transfered in a strange manners.
Currently one of the corruption case (not enough data) lead to a crash. We add
explicit tests for theses cases.
Differential Revision: https://phab.mercurial-scm.org/D10457
Matt Harbison <matt_harbison@yahoo.com> [Sat, 17 Apr 2021 00:28:21 -0400] rev 46969
cmdutil: fix an uninitialize variable usage in clearunfinished()
I happened to notice that PyCharm flagged this while looking for something else.
I'm pretty sure it meant to check the current state in the iteration, and not
keep reusing the last one in the previous iteration.
Differential Revision: https://phab.mercurial-scm.org/D10459
Aay Jay Chan <aayjaychan@itopia.com.hk> [Mon, 05 Apr 2021 14:19:17 +0800] rev 46968
help: document `$HG_NEW_OBSMARKERS` in pretxnclose hook
Differential Revision: https://phab.mercurial-scm.org/D10399
Aay Jay Chan <aayjaychan@itopia.com.hk> [Thu, 01 Apr 2021 22:43:55 +0800] rev 46967
help: prepend environment variables used in hooks with "$"
Most of them have "$" prefix but some don't, so adding it for consistency.
Differential Revision: https://phab.mercurial-scm.org/D10398
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Apr 2021 09:59:12 +0200] rev 46966
revset: drop an outdated comment
There is not `ui.expandpath` call there anymore.
Differential Revision: https://phab.mercurial-scm.org/D10435
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Apr 2021 01:03:12 +0200] rev 46965
ui: deprecated `ui.expandpath`
This function return a single path, something incompatible with the coming
change to `[paths]` definition to allow multiple associated urls.
Now that all user got migrated, we deprecate the function.
Differential Revision: https://phab.mercurial-scm.org/D10432
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 21:29:27 +0200] rev 46964
urlutil: remove usage of `ui.expandpath` in `get_clone_path`
We want to deprecate `ui.expandpath` and simplify the code before adding more
complexity in the form of `[paths]` entry pointing to multiple url. So we inline
the relevant bits.
Differential Revision: https://phab.mercurial-scm.org/D10431
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 21:27:00 +0200] rev 46963
urlutil: remove usage of `ui.expandpath` in `get_unique_pull_path`
We want to deprecate `ui.expandpath` and simplify the code before adding more
complexity in the form of `[paths]` entry pointing to multiple url. So we inline
the relevant bits.
Differential Revision: https://phab.mercurial-scm.org/D10430
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 21:20:58 +0200] rev 46962
urlutil: remove usage of `ui.expandpath` in `get_pull_paths`
We want to deprecate `ui.expandpath` and simplify the code before adding more
complexity in the form of `[paths]` entry pointing to multiple url. So we inline
the relevant bits.
Differential Revision: https://phab.mercurial-scm.org/D10429
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 21:15:53 +0200] rev 46961
debugbackupbundle: use `get_unique_pull_path`
This is the last known user of `ui.expandpath` outside of `urlutil`. Hooray.
Differential Revision: https://phab.mercurial-scm.org/D10428
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 21:15:22 +0200] rev 46960
debugssl: use `get_unique_pull_path`
Let's move this code to the new API.
Differential Revision: https://phab.mercurial-scm.org/D10427
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 21:11:39 +0200] rev 46959
debugdiscovery: use `get_unique_pull_path`
Lets move this code to the new API.
Differential Revision: https://phab.mercurial-scm.org/D10426
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 21:02:38 +0200] rev 46958
profiling: use `util.expandpath` instead of `ui.expandpath` for output
Given we are talking about the path to an output file, I am fairly certain that
the initial author meant to expand `~` and the like and not to resolve entry
from `[paths]`.
Differential Revision: https://phab.mercurial-scm.org/D10425
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 20:57:34 +0200] rev 46957
dispatch: use the new API to resolve --repository
An even weirder feature of Mercurial is the ability to use `[paths]` alias as
value of `--repository`. The weird feature now use the new APIs.
Differential Revision: https://phab.mercurial-scm.org/D10424
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 20:21:11 +0200] rev 46956
revset: use `get_unique_pull_path` for `remote(…)`
This one is also resolving path. For now we restrict the feature to a single
destination. This might change in the future.
Differential Revision: https://phab.mercurial-scm.org/D10422
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 20:15:09 +0200] rev 46955
remotefilelog: use `get_unique_pull_path` in `getflogheads`
Another command moved to the new API, hooray.
Differential Revision: https://phab.mercurial-scm.org/D10421
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 19:30:48 +0200] rev 46954
summary: use the new APIs
Summary can perform some incoming/outgoing queries (that should be common to the
other command with the same needs, but that is another story).
We now use the new APIs to do so. The current code behavior is a bit fishy,
relying to the fact "default" will be picked as the destination in last resort.
I did not altered that, but left various comment to highlight the issue.
Differential Revision: https://phab.mercurial-scm.org/D10420
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 18:37:29 +0200] rev 46953
share: use `get_clone_path`
Since `hg share` is mostly like clone, do the same changes there.
Differential Revision: https://phab.mercurial-scm.org/D10419
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 18:02:25 +0200] rev 46952
init: use `get_clone_path` when suitable
`hg init` has this weird feature were you can refer to `[paths]` entry select the path to initialize. We move that code to the new APIs.
Differential Revision: https://phab.mercurial-scm.org/D10418
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 18:34:42 +0200] rev 46951
clone: use `get_clone_path`
"Surprisingly", the new API is well suited for `hg clone` too.
Differential Revision: https://phab.mercurial-scm.org/D10417
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 17:41:02 +0200] rev 46950
incoming: kill the `repo._subtoppath =` hack
We do the same as for `hg outgoing`, instead of relying on implicit passing
value by monkey punching them onto the repo object, we pass equivalent
information by argument to the proper function.
This is way cleaner.
Differential Revision: https://phab.mercurial-scm.org/D10416
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 17:29:27 +0200] rev 46949
identify: use `get_unique_pull_path`
The command only support a single destination. We use the associated API.
Differential Revision: https://phab.mercurial-scm.org/D10415
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 17:02:20 +0200] rev 46948
bundle: support multiple destinations
`hg outgoing` and `hg push` now support multiple destination. We do the same
for `hg bundle`. Various other commands needs this kind of behavior and it
would be create to factor this code out for their usage. However this is an
adventure for another time.
They are some minor change to the tests (in addition to the new test for the
feature):
* one because I updated a message to plurals,
* another one because the error changed, and I actually find it clearer.
Differential Revision: https://phab.mercurial-scm.org/D10414
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 14:35:13 +0200] rev 46947
lfs: use the new APIs
The part of the lfs store that requires a destination cannot operate on multiple destination (yet). So we move them to the dedicated APIs.
Differential Revision: https://phab.mercurial-scm.org/D10413
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 13:06:09 +0200] rev 46946
fastannotate: use `get_unique_pull_path`
The code does not support multiple destination yet, so lets move it to the
dedicated API.
Differential Revision: https://phab.mercurial-scm.org/D10412
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 12:57:55 +0200] rev 46945
remotefilelog: use the right expandpath in to expand `~`
Given the context where path is most likely a file system path, I suspect that
the initial author confused ui.expandpath and util.expandpath (a proxy for
os.path.expanduser and co)
Differential Revision: https://phab.mercurial-scm.org/D10411
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 16 Apr 2021 10:46:56 +0200] rev 46944
transplant: use `get_unique_pull_path`
The command does not support multiple destination (yet).
Differential Revision: https://phab.mercurial-scm.org/D10410
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 16 Apr 2021 10:46:52 +0200] rev 46943
infinitepush: use `get_unique_pull_path`
The extension does not support multiple destination (yet).
Differential Revision: https://phab.mercurial-scm.org/D10456
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 12:29:44 +0200] rev 46942
relink: use `get_unique_pull_path`
The code does not support multiple destination and will probably never do so.
So lets use the dedicated API for this case.
Differential Revision: https://phab.mercurial-scm.org/D10409
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 12:01:27 +0200] rev 46941
histedit: use `get_unique_push_path`
Same as for `pathbomb`, this code does not support multiple destinations yet. It might in the future, probably with code put in common with patchwork, but for now lets use the dedicated API.
Differential Revision: https://phab.mercurial-scm.org/D10408
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 11:57:20 +0200] rev 46940
urlutil: add a new `get_unique_push_path`
This function is dedicated to call that needs a single destination. Currently
most caller actually need that since few actually support multiple destinations
(the most importants `hg push` and `hg outgoing` do). So having a clear API
point for that will be important when the time comes to have a single `[paths]`
alias resolving to multiple urls.
Differential Revision: https://phab.mercurial-scm.org/D10407
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 11:38:10 +0200] rev 46939
fetch: use `get_unique_pull_path` to retrieve the path
The fetch command does not support multiple destination, so we use the new dedicated API for that.
Differential Revision: https://phab.mercurial-scm.org/D10406
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 11:30:49 +0200] rev 46938
patchbomb: use `get_unique_pull_path`
The patchbomb code does not support multiple destinations yet. It would not be
too hard to implemented since `hg outgoing` does. However that is a bit too
much of a detour right now. In addition that kind of "select outgoing
changesets for processing" code exist for various commands so the best would be
to factor it out later.
Let us use the dedicated API until this is solved.
This comes with a small output change in the test that I find more accurate. So
I kept it.
Differential Revision: https://phab.mercurial-scm.org/D10405
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 11:18:48 +0200] rev 46937
narrow: use `get_unique_pull_path`
The narrow's `tracked` command does not support multiple destination, lets use
the dedicated API then.
Differential Revision: https://phab.mercurial-scm.org/D10404
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 11:15:54 +0200] rev 46936
urlutil: add a new `get_unique_pull_path`
This function is dedicated to call that needs a single destination. Currently most caller actually need that since few actually support multiple destinations (the most importants `hg push` and `hg outgoing` do). So having a clear API point for that will be important when the time comes to have a single `[paths]` alias resolving to multiple urls.
Differential Revision: https://phab.mercurial-scm.org/D10403
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 10:51:31 +0200] rev 46935
mq: use the new `get_clone_path` to get the remote url
We stop using `ui.expandpath` to use a function with a more defined semantic. This will help us to make it an option to point [paths] entry to multiple destination.
Differential Revision: https://phab.mercurial-scm.org/D10402
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 10:35:40 +0200] rev 46934
urlutil: add a `get_clone_path` function
We add a new function with a semantic focussed on `clone` operation (so without
an existing repository). I am not certain the return type is the best, but this
is what we need for now. Once all caller are migrated we might start thinking
about that the API should be. For now that will do.
Differential Revision: https://phab.mercurial-scm.org/D10401
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 11 Apr 2021 19:18:54 +0200] rev 46933
outgoing: use `get_push_paths` in the revset too
The revsets now use the same code as everyone and is ready for entry in
`[paths]` pointing to multiple entries.
Differential Revision: https://phab.mercurial-scm.org/D10393
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 02:14:15 +0200] rev 46932
incoming: use `urlutil.get_pull_paths`
Lets use the new method to increase code reuse. However I did not implement
support for multiple source yet. It would be possible create multiple temporary
bundle, but that is a bit too much work outside of my current route to make the
detour.
Differential Revision: https://phab.mercurial-scm.org/D10392
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 01:26:44 +0200] rev 46931
outgoing: accept multiple destinations
This align the behavior of `hg outgoing` with the one of `hg incoming`. In addition this prepare the introduction of having simple `path` resolve to multiple destination in practice (eg: `default`)
Differential Revision: https://phab.mercurial-scm.org/D10391
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Apr 2021 09:23:28 +0200] rev 46930
outgoing: pass subrepo path using function argument instead of abssource hack
This is clearer, remove the needs for the `repo._subtoppath` hack and will make
our live easier when making `outgoing` accept multiple destinations.
Differential Revision: https://phab.mercurial-scm.org/D10390
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Apr 2021 09:23:19 +0200] rev 46929
subrepo: introduce a `repo_rel_or_abs_source` function
The `subrepoutil` module has various function to compute the path of a
sub-repository compared to the root of the top repository. However, they was no
function available to compute the relative path of the repository "source". And
we need this information for exchange operation (in our case, `hg outgoing`).
The information is currently build using the `repo._subtoppath` hack. We reuse
the same logic but in a dedicated function independent of the `repo._subtoppath`
hack.
Differential Revision: https://phab.mercurial-scm.org/D10434
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Apr 2021 22:50:41 -0400] rev 46928
urlutil: use bytes for Abort messages
Caught by pytype. Also fix a minor grammar issue in the second message.
Differential Revision: https://phab.mercurial-scm.org/D10433
Raphaël Gomès <rgomes@octobus.net> [Thu, 08 Apr 2021 16:41:13 +0200] rev 46927
changegroup: update comment
Gratuitous fix, I stumbled upon this comment while reading code.
Differential Revision: https://phab.mercurial-scm.org/D10339
Matt Harbison <matt_harbison@yahoo.com> [Mon, 12 Apr 2021 23:31:54 -0400] rev 46926
re2: adjust local variable assignment scope
Pytype flagged the exception handler where these are used as `[name-error]`, and
PyCharm complained they may be used before assignment.
Differential Revision: https://phab.mercurial-scm.org/D10376
Simon Sapin <simon.sapin@octobus.net> [Sat, 13 Mar 2021 09:50:34 +0100] rev 46925
rhg: Make `files` work on repo-relative paths when possible
When the current directory is outside of the repository we need to turn
everything into absolute filesystem paths in order to compute correct
relative paths.
This was previously done unconditionally, but is not necessary when
the current directory is inside the repository.
With this change `rhg files > /dev/null` at the root of a mozilla-central
snapshot goes from ~150 ms to ~70 ms. My repository is located at a
somewhat long path though (93 bytes). The effect may not be as pronounced
at a shorter path.
Differential Revision: https://phab.mercurial-scm.org/D10200
Kyle Lippincott <spectral@google.com> [Mon, 12 Apr 2021 19:25:34 -0700] rev 46924
split: avoid strip if split is a no-op (identical to original)
Differential Revision: https://phab.mercurial-scm.org/D10389
Kyle Lippincott <spectral@google.com> [Mon, 12 Apr 2021 17:52:46 -0700] rev 46923
split: fix issue with empty splits adjusting phases
Differential Revision: https://phab.mercurial-scm.org/D10388
Kyle Lippincott <spectral@google.com> [Mon, 12 Apr 2021 17:51:56 -0700] rev 46922
split: add test demonstrating issue with empty splits adjusting phases
Differential Revision: https://phab.mercurial-scm.org/D10387
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 16:09:12 +0200] rev 46921
test-lfs: fix expected output
This is not covered by the CI and was broken.
Differential Revision: https://phab.mercurial-scm.org/D10397
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 15:56:21 +0200] rev 46920
test-lfs: avoid a bashism when spawning the server
For zsh, this &> call is read as "& >", this spin the process without
redirection. As a result the server grab stdout, which does not get closed at the
end of the test. As a result `run-tests.py` hang there forever, waiting for the
the stream for be close. (which is probably as issue on its own).
Differential Revision: https://phab.mercurial-scm.org/D10396
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 15:54:32 +0200] rev 46919
test-lfs: avoid pagination
Otherwise, the pagination can trigger in when running the test with --debug,
blocking the test execution for no good reason.
Differential Revision: https://phab.mercurial-scm.org/D10395
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Apr 2021 15:53:43 +0200] rev 46918
run-test: make it clearer why we terminating process
The --verbose log wer only talking about process termination. Now we have more
information about why.
Differential Revision: https://phab.mercurial-scm.org/D10394
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Apr 2021 15:30:32 +0200] rev 46917
push-dests: move the code around missing default dest inside `get_push_paths`
This function has a clear semantic and moving the code dealing with this inside
it will help reduce duplication.
Differential Revision: https://phab.mercurial-scm.org/D10385
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Apr 2021 15:32:59 +0200] rev 46916
push-dests: rework the handling of default value
This new core is more straightforward and doing this early will make the next
changeset simpler.
Differential Revision: https://phab.mercurial-scm.org/D10384
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 11 Apr 2021 20:00:46 +0200] rev 46915
outgoing: merge the code handling --graph with the main one
The --graph code had its own copy of the logic. With the previous reorganisation
of the code, we can now merge it with the main code, reducing fragile
complication.
As a side effect, `hg out --graph` now use the right return code when they are
nothing outgoing. This explain the change to output in
`tests/test-largefiles-misc.t`.
Differential Revision: https://phab.mercurial-scm.org/D10383
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Apr 2021 15:13:20 +0200] rev 46914
outgoing: move filtering logic in its own function
This move code dedicated to a single purpose together and make the main code
simpler. Right when we are getting ready to make it more complex :-D
Differential Revision: https://phab.mercurial-scm.org/D10382
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 11 Apr 2021 19:31:03 +0200] rev 46913
outgoing: make `recurse` a real function
If we want to use this in a loop, we need to be able to pass argument.
Differential Revision: https://phab.mercurial-scm.org/D10381
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 11 Apr 2021 19:20:14 +0200] rev 46912
outgoing: remove some early return
Since
066b8d8f75b8, the push command accept multiple destination. However `hg
outgoing` does not. On the way to fix this, we need to clean up the outgoing
code. We start with removing some early return to make the code ready to house
more changes.
Differential Revision: https://phab.mercurial-scm.org/D10380
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 10 Apr 2021 21:55:01 +0200] rev 46911
infinitepush: use the new function to determine push destination
Since
066b8d8f75b8, the push command accept multiple destination. `infinitepush`
was not aware of that. We now use the new `urlutil.get_push_paths` function to
determine the push destination, fixing the issue. This will also make future
evolution of that logic transparent for infinitepush
We still disallow push to multiple destinations if infinite push is enabled
because I don't know what this means for infinite push. However user will now
get a clear error message instead of a crash.
Differential Revision: https://phab.mercurial-scm.org/D10379
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Apr 2021 12:28:44 +0200] rev 46910
urlutil: add a `get_pull_paths` to perform the pull destination logic
As is this changeset does not change anything. However having an official empty
point will help unifying the logic and encapsulate the details and update the
logic to support path definition pointing to multiple other path.
Differential Revision: https://phab.mercurial-scm.org/D10378
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 12 Apr 2021 22:22:56 +0200] rev 46909
urlutil: add a `get_push_paths` to perform the push destination logic
As is this changeset does not change anything. However having an official empty
point will help unifying the logic and encapsulate the details and update the
logic to support path definition pointing to multiple other path.
Differential Revision: https://phab.mercurial-scm.org/D10377
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 12 Apr 2021 06:34:54 +0200] rev 46908
urlutil: extract `parseurl` from `hg` into the new module
The new module is well fitting for this new code. And this will be useful to
make the gathered code collaborate more later.
Differential Revision: https://phab.mercurial-scm.org/D10375
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 12 Apr 2021 03:01:04 +0200] rev 46907
urlutil: extract `url` related code from `util` into the new module
The new module is well fitting for this new code. And this will be useful to
make the gathered code collaborate more later.
Differential Revision: https://phab.mercurial-scm.org/D10374
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 11 Apr 2021 23:54:35 +0200] rev 46906
urlutil: extract `path` related code into a new module
They are a lot of code related to url and path handling scattering into various
large module. To consolidate the code before doing more change (for defining
"multi-path"), we gather it together.
Differential Revision: https://phab.mercurial-scm.org/D10373
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 10 Apr 2021 15:30:32 +0200] rev 46905
help: document the `path://` url scheme
If we want people to use it, we need to document it.
Differential Revision: https://phab.mercurial-scm.org/D10372
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 10 Apr 2021 15:28:10 +0200] rev 46904
help: point to `hg help urls` in `hg help config.paths`
This seems useful to point at what people can put as value for these config.
Differential Revision: https://phab.mercurial-scm.org/D10371
Matt Harbison <matt_harbison@yahoo.com> [Mon, 12 Apr 2021 22:42:47 -0400] rev 46903
merge with stable
Charles Chamberlain <cchamberlain@janestreet.com> [Fri, 09 Apr 2021 17:41:48 -0400] rev 46902
narrow: add capabilities for local repos, not just remote peers
This fixes the bug where running `hg clone --narrow ./local-repo`
fails with
abort: server does not support narrow clones
even when the server has narrow enabled.
Differential Revision: https://phab.mercurial-scm.org/D10357
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Mar 2021 22:29:41 -0400] rev 46901
typing: make minor adjustments to mercurial/util.py to pass pytype checking
I'm assuming the wrong-arg-count is a pytype bug, because this code is used by
the config object. Avoiding initializing `_lrucachenode` node points to None
eliminates a few `is not None` assertions, but apparently not all of them. I
can't figure out why it gets confused over the state where these new assertions
are.
Differential Revision: https://phab.mercurial-scm.org/D10276
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Mar 2021 20:22:00 -0400] rev 46900
util: fix the signature for the pypy override of sortdict.update()
PyCharm flagged this as not matching the base class signature. Not sure if
there was anything supplying these extra arguments though.
Differential Revision: https://phab.mercurial-scm.org/D10275
Matt Harbison <matt_harbison@yahoo.com> [Thu, 25 Mar 2021 18:59:14 -0400] rev 46899
typing: add type hints to mercurial/error.py
The only slightly unusual things here are that `location` is passed to
`ParseError` and both bytes and an int (so this accepts both), and the message
passed `ProgrammingError` is immediately converted to str. Therefore it is
typed as `AnyStr`, because there are a couple of instances that are already
passed as str.
There are a couple of places where bytes are being passed to builtin exceptions
that might need to be converted to str.
Differential Revision: https://phab.mercurial-scm.org/D10274
Matt Harbison <matt_harbison@yahoo.com> [Fri, 19 Mar 2021 00:36:26 -0400] rev 46898
tests: add a (very slow) test that executes pytype
This is an updated form of D7295, and completes successfully with pytype
2021.03.22. The 5 or so crashes that were mostly in the hgweb files seems to
have been fixed in 2021.03.10.
Differential Revision: https://phab.mercurial-scm.org/D10237
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 10:38:27 +0200] rev 46897
upgrade: do not hardcore file extension of revlogs
This logic already lives inside the `store` module. So lets reuse it instead.
Differential Revision: https://phab.mercurial-scm.org/D10317
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 10:38:11 +0200] rev 46896
upgrade: take advantage of the new information returned by `store.walk`
Before this change the upgrade code had to analyse filename to process them directly. Lets keep that logic private to the store and more to a more robust explicit approach.
Differential Revision: https://phab.mercurial-scm.org/D10316
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 10:38:03 +0200] rev 46895
store: also return some information about the type of file `walk` found
We start returning of 4th information in the `store.walk` return tuple: the type of the file. This will make it easier for caller to determine which kind of file they are looking at. This should especically help with the `upgrade-repo` code that has to do a lot of fragile index's file name comparison.
Differential Revision: https://phab.mercurial-scm.org/D10315
Matt Harbison <matt_harbison@yahoo.com> [Mon, 05 Apr 2021 23:54:54 -0400] rev 46894
tests: skip test-git-interop.t on Windows
Casefolding isn't handled in dirstate yet, triggering a bunch of assertions.
But while this is more correctly `no-icasefs`, it's more likely to get attention
if someone sees it. I'd just rather not have it adding to the noise on Windows
for now.
Differential Revision: https://phab.mercurial-scm.org/D10312
Matt Harbison <matt_harbison@yahoo.com> [Mon, 05 Apr 2021 13:02:51 -0400] rev 46893
contrib: restore the `hg fix` configuration in the examples
After
decc3bd3f20d, running `black` will DTRT, but running `hg fix` did nothing
(unless the example config file was %included, in which case it truncated the
file instead of formatting it). I'm not sure why that was happening, but let's
not leave a code shredder laying around.
Differential Revision: https://phab.mercurial-scm.org/D10311
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Wed, 31 Mar 2021 17:54:02 -0400] rev 46892
blackbox: fix type error on log rotation on read-only filesystem
Grepping around, the code uses either encoding.strtolocal or
stringutil.forcebytestr in this situation. No idea which is best.
Differential Revision: https://phab.mercurial-scm.org/D10293
Simon Sapin <simon.sapin@octobus.net> [Thu, 08 Apr 2021 14:38:27 +0200] rev 46891
rust: Remove use of `py.eval()`
The previous Rust code allocated an intermediate `Vec`, converted that
to a Python list, then used `eval` to run Python code that converts that
list to a Python set.
rust-cpython exposes Rust bindings for Python sets, let’s use that instead
to construct a set directly.
Differential Revision: https://phab.mercurial-scm.org/D10328
Simon Sapin <simon.sapin@octobus.net> [Thu, 08 Apr 2021 21:46:54 +0200] rev 46890
rust: Remove the compile-time 'dirstate-tree' feature flag
This code has compiler errors since it is not built on CI and nobody has been
working on it for some time.
We (Octobus) are still pursuing status optimizations based on a tree data
structure for the dirstate, but upcoming patches will use a run-time opt-in
instead of compile-time, so that at least corresponding Rust code keeps
compiling when other changes are made.
Differential Revision: https://phab.mercurial-scm.org/D10329