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