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