Raphaël Gomès <rgomes@octobus.net> [Wed, 21 Dec 2022 12:26:00 +0100] rev 49922
verify: print short `p1` node in relevant dirstate messages
This will help with debugging.
Raphaël Gomès <rgomes@octobus.net> [Mon, 02 May 2022 11:27:20 +0200] rev 49921
verify: also check dirstate
The dirstate already is capable of verifying its integrity (although v2
features are not yet checked), let's run that code in `hg verify`.
Raphaël Gomès <rgomes@octobus.net> [Mon, 02 May 2022 17:47:38 +0200] rev 49920
tests: use the `--quiet` flag for verify when applicable
This reduces a lot of the test output that was otherwise useless, and also
makes it a lot easier to add things to verify without breaking the test suite
because of additional output.
Raphaël Gomès <rgomes@octobus.net> [Wed, 21 Dec 2022 12:03:02 +0100] rev 49919
verify: format messages directly at the source
Raphaël Gomès <rgomes@octobus.net> [Mon, 02 May 2022 11:58:43 +0200] rev 49918
dirstate: update messages in verify to not use the old `state` API
Raphaël Gomès <rgomes@octobus.net> [Mon, 02 May 2022 17:39:01 +0200] rev 49917
dirstate: add narrow support to `verify`
This will be called later in the series by the `verify` command.
Raphaël Gomès <rgomes@octobus.net> [Mon, 02 May 2022 11:42:23 +0200] rev 49916
dirstate: stop using `entry.state()` for logic in `verify`
Use the new API instead of the deprecated one. The next changeset will remove
the use of `state` in this method altogether (currently still in the messages)
Raphaël Gomès <rgomes@octobus.net> [Mon, 02 May 2022 11:40:33 +0200] rev 49915
dirstate-entry: add `modified` property
This was already done in the Rust implementation and is a useful primitive.
The C implementation had this called `merged`, but wasn't used anywhere.
It will be used in the next changeset.
Franck Bret <franck.bret@octobus.net> [Mon, 19 Dec 2022 16:22:01 +0100] rev 49914
debug: add debug-revlog-stats command
Display statistics about revlogs in the store. Useful to get an approximate
size of a repository, etc. More statistics will be added in the future.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Dec 2022 22:24:05 -0500] rev 49913
typing: attempt to remove @overloads in the platform module for stdlib methods
This is mostly successful, as examining util.pyi, posix.pyi, and windows.pyi
after a pytype run shows that the type overloads for `oslink`, `readlink`,
`removedirs`, `rename`, `split`, and `unlink` have been removed. (Some of these
still have an @overload, but the differences are the variable names, not the
types.) However, @overloads remain for `abspath` and `normpath` for some
reason.
It's useful to redefine these methods for the type checking phase because in
addition to excluding str and PathLike variants, some of these functions have
optional args in stdlib that aren't implemented in the custom implementation on
Windows, and we want the type checking to flag that instead of assuming it's an
allowable overload everywhere.
One last quirk I noticed that I can't explain- `pycompat.TYPE_CHECKING` is
always False, so the conditionals need to check `typing.TYPE_CHECKING` directly.
I tried dropping the custom code for assigning `pycompat.TYPE_CHECKING` and
simply did `from typing import TYPE_CHECKING` directly in pycompat.py, and used
`pycompat.TYPE_CHECKING` for the conditional here... and pytype complained that
`pycompat` doesn't have the `TYPE_CHECKING` variable.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Dec 2022 22:07:02 -0500] rev 49912
typing: add trivial type hints to rest of the windows platform module
Skipping the file wrappers for now because there's interplay with C code, and
making them subclass `typing.BinaryIO_Proxy` confuses PyCharm a bit.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Dec 2022 18:27:15 -0500] rev 49911
typing: add type hints to the rest of the posix module
These methods either don't have an analog in the windows module, or are aliased
in the windows module from something else (like os.path.xxx).
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Dec 2022 18:14:54 -0500] rev 49910
typing: add type hints to the platform `cachestat` classes
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Dec 2022 14:24:02 -0500] rev 49909
util: fix the signature of observedbufferedinputpipe._fillbuffer()
Flagged by PyCharm, since it didn't match the signature of the method being
overridden. The default value in the superclass is also `_chunksize`, and I
suspect that the amount read from `osread` should be limited to what is passed
in. Only one caller (`bufferedinputpipe.unbufferedread()`) passes this
argument, and it passes the max of `_chunksize` and whatever it was passed.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Dec 2022 14:15:09 -0500] rev 49908
tests: drop some obsolete py2 handling in util.py doctest
Flagged by PyCharm while inspecting imports from the platform modules.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Dec 2022 00:54:39 -0500] rev 49907
typing: add type hints to the common posix/windows platform functions
These are done in sync because some platforms have empty implementations, and it
isn't obvious what the types should be without examining the other. We want the
types aligned, so @overload definitions that differ aren't generated. The only
differences here are the few methods that unconditionally raise an error are
marked as `NoReturn`, which doesn't seem to bother pytype.
A couple of the posix module functions needed to be updated with a modern
ternary operator, because pytype seems to want to use the type of the second
object in the old `return x and y` style.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Dec 2022 21:13:11 -0500] rev 49906
typing: add type hints to the posix platform module matching win32.py
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Dec 2022 18:02:55 -0500] rev 49905
typing: add type hints to mercurial/win32.py
These are the low level functions that are imported by the mercurial.windows
module, which is in turn imported by mercurial.utils as the platform module.
Pretty straightforward, but pytype inferred very little of it, likely because of
the heavy ctypes usage. It also seems to trigger a pytype bug in procutil, now
that it has an idea of the underlying function type, so disable that warning to
maintain a working test.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Dec 2022 15:46:25 -0500] rev 49904
windows: drop some py2 registry module importing
The comment was actually backwards- `winreg` is importable on py3, and is
already imported by mercurial/windows.py.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Dec 2022 15:41:59 -0500] rev 49903
typing: add type hints to the platform specific scm modules
Surprisingly, pytype struggled to figure out the return types in the posix
functions.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Dec 2022 01:05:27 -0500] rev 49902
typing: add type hints to most mercurial/pycompat.py functions
The `rapply` methods are left out because it's not `rapply(f, xs: _T0) -> _T0`
as I first thought- it's used somewhere to walk a collection and convert between
bytes and str.
Also, the `open()` call is partially untyped because I'm not sure what its
purpose is at this point- both the name and mode can be either bytes or str as
it is currently constituted. It might make sense to assert that the file is
being opened in binary mode (like `namedtempfile()`) and cast the result to
`BinaryIO`, but that shouldn't be smuggled in with these other changes. The
return is currently typed as `Any` because something suddenly got smarter and a
few uses in util.py (like readfile()) suddenly think it returns `IO[str]`
instead of `IO[bytes]` (BinaryIO), and it flags the type mismatch there.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 22:27:22 -0500] rev 49901
statprof: don't pass str `sys.argv` to a function expecting bytes
Found by typing the global functions in mercurial.pycompat.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 22:24:54 -0500] rev 49900
typing: drop an unnecessary warning disabling comment in match.py
This stopped being necessary in d2e1dcd4490d, when the exception stopped being
subscripted.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 22:22:12 -0500] rev 49899
scmposix: don't subscript IOError
This warning disabling has been in place since late 2019 in 667f56d73ceb. We
should have had some py3 support at the time, but both pytype complains and
subscripting a real FileNotFoundError generated in `hg debugshell` crashed, so
maybe this fixes a problem. It looks like all other instances of subscripting
exceptions have been replaced (at least as far as greping for `== errno.`
revealed).
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 01:51:33 -0500] rev 49898
typing: add type hints to pycompat.bytestr
The problem with leaving pytype to its own devices here was that for functions
that returned a bytestr, pytype inferred `Union[bytes, int]`. It now accepts
that it can be treated as plain bytes.
I wasn't able to figure out the arg type for `__getitem__`- `SupportsIndex`
(which PyCharm indicated is how the superclass function is typed) got flagged:
File "/mnt/c/Users/Matt/hg/mercurial/pycompat.py", line 236, in __getitem__:
unsupported operand type(s) for item retrieval: bytestr and SupportsIndex [unsupported-operands]
Function __getitem__ on bytestr expects int
But some caller got flagged when I marked it as `int`.
There's some minor spillover problems elsewhere- pytype doesn't seem to
recognize that `bytes.startswith()` can optionally take a 3rd and 4th arg, so
those few places have the warning disabled. It also flags where the tar API is
being abused, but that would be a tricky refactor (and would require typing
extensions until py3.7 is dropped), so disable those too.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 01:38:52 -0500] rev 49897
pycompat: explicitly prefix builtin attr usage with `builtins.`
It doesn't seem like this would fix any bug, because the wrapped functions that
take bytes instead of str are defined after these calls. But PyCharm was
flagging the second and third uses, saying "Type 'str' doesn't have expected
attribute 'decode'". It wasn't flagging the first, but I changed it for
consistency.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Dec 2022 01:32:03 -0500] rev 49896
typing: add type hints to global variables in mercurial/pycompat.py
The way `osaltsep` and `sysexecutable` were defined, pytype determined them to
be `Union[bytes, str]`. This was a problem because that cascaded to all of the
callers, and also because it couldn't be annotated as bytes on the initial
assignment. Therefore, we use a ternary operator.
The documentation says that `sys.executable` can either be None or an empty
string if the value couldn't be determined. We opt for an empty string here
because there are places that blindly pass it to `os.path.xxx()` functions,
which crash if given None. Other places test `if pycompat.sysexecutable`, so
empty string works for both.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 13 Dec 2022 16:48:47 -0500] rev 49895
windows: drop an unused method
The only caller was removed in 563eb25e079b.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 12 Dec 2022 14:10:12 -0500] rev 49894
typing: add type hints to the prompt methods in mercurial/ui.py
The @overloads allow for the callers that pass a non-None `default` to not have
to worry about handling a None return to appease pytype.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 12 Dec 2022 14:17:05 -0500] rev 49893
ui: split the `default` arg out of **kwargs for the internal prompt method
This arg was required anyway, based on how it was accessed. Having it separate
allows it to be typed though, and this will simplify things for the callers- if
a non-None `default` is passed, the return can never be None. That can be
expressed with `@overload` when the arg can be typed, but that's not possible
when it is rolled up in **kwargs.
The default value is simply copied from the public `prompt()` above it.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Dec 2022 00:10:56 -0500] rev 49892
typing: add trivial type hints to mercurial/ui.py
There's not really a pattern here; it's mostly obvious return types and in a few
cases, obvious parameter types. Some other "obvious" functions are left out
because of quirks in how the return value for the various config() functions are
inferred cause pytype to complain.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Dec 2022 14:57:42 -0500] rev 49891
doc: don't pass str to ui methods in check-seclevel.py
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Dec 2022 14:44:46 -0500] rev 49890
typing: add type hints related to message output in mercurial/ui.py
This will shake loose some bytes vs str issues in the doc checker.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Dec 2022 00:22:13 -0500] rev 49889
typing: add type hints related to progress bars in mercurial/ui.py
Pretty low hanging fruit while trying to deal with other more complicated parts
of this module.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 25 Nov 2022 18:39:47 -0500] rev 49888
pytype: stop excluding mercurial/ui.py
ui.extractchoices() is perhaps making assumptions that it shouldn't about the
pattern always matching, but presumably we have test coverage for that.
PyCharm flags the updated classes with a warning "Class xxx must implement all
abstract methods", and suggests adding `abc.ABC` to the superclasses. I'm not
sure why, unless it doesn't recognize the `__getattr__()` delegation pattern.
Additionally, we can't unconditionally subclass `typing.BinaryIO` because that
defeats the `__getattr__` delegation to the wrapped object at runtime. Instead,
it has to only subclass during the type checking phase[1].
In any event, this fixes:
File "/mnt/c/Users/Matt/hg/mercurial/ui.py", line 1518, in _runpager:
Function subprocess.Popen.__new__ was called with the wrong arguments [wrong-arg-types]
Expected: (cls, args, bufsize, executable, stdin,
stdout: Optional[Union[IO, int]] = ..., ...)
Actually passed: (cls, args, bufsize, stdin,
stdout: Union[mercurial.utils.procutil.WriteAllWrapper,
mercurial.windows.winstdout], ...)
File "/mnt/c/Users/Matt/hg/mercurial/ui.py", line 1798, in extractchoices:
No attribute 'group' on None [attribute-error]
In Optional[Match[bytes]]
File "/mnt/c/Users/Matt/hg/mercurial/ui.py", line 1799, in extractchoices:
No attribute 'group' on None [attribute-error]
In Optional[Match[bytes]]
[1] https://stackoverflow.com/q/71365594
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Dec 2022 20:12:23 +0100] rev 49887
bundle: emit full snapshot as is, without doing a redelta
With the new `forced` delta-reused policy, it become important to be able to
send full snapshot where full snapshot are needed. Otherwise, the fallback delta
will simply be used on the client sideā¦ creating monstrous delta chain, since
revision that are meant as a reset of delta-chain chain becoming too complex are
simply adding a new full delta-tree on the leaf of another one.
In the `non-forced` cases, client process full snapshot from the bundle
differently from deltas, so client will still try to convert the full snapshot
into a delta if possible. So this will no lead to pathological storage
explosion.
I have considered making this configurable, but the impact seems limited enough
that it does not seems to be worth it. Especially with the current
sparse-revlog format that use "delta-tree" with multiple level snapshots, full
snapshot are much less frequent and not that different from other intermediate
snapshot that we are already sending over the wire anyway.
CPU wise, this will help the bundling side a little as it will not need to
reconstruct revisions and compute deltas. The unbundling side might save a tiny
amount of CPU as it won't need to reconstruct the delta-base to reconstruct the
revision full text. This only slightly visible in some of the benchmarks. And
have no real impact on most of them.
### data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog
# benchmark.name = perf-bundle
# benchmark.variants.revs = last-40000
before: 11.467186 seconds
just-emit-full: 11.190576 seconds (-2.41%)
with-pull-force: 11.041091 seconds (-3.72%)
# benchmark.name = perf-unbundle
# benchmark.variants.revs = last-40000
before: 16.744862
just-emit-full:: 16.561036 seconds (-1.10%)
with-pull-force: 16.389344 seconds (-2.12%)
# benchmark.name = pull
# benchmark.variants.revs = last-40000
before: 26.870569
just-emit-full: 26.391188 seconds (-1.78%)
with-pull-force: 25.633184 seconds (-4.60%)
Space wise (so network-wise) the impact is fairly small. When taking compression into
account.
Below are tests the size of `hg bundle --all` for a handful of benchmark repositories
(with bzip, zstd compression and without it)
This show a small increase in the bundle size, but nothing really significant
except maybe for mozilla-try (+12%) that nobody really pulls large chunk of anyway.
Mozilla-try is also the repository that benefit the most for not having to
recompute deltas client size.
### mercurial:
bzip-before: 26 406 342 bytes
bzip-after: 26 691 543 bytes +1.08%
zstd-before: 27 918 645 bytes
zstd-after: 28 075 896 bytes +0.56%
none-before: 98 675 601 bytes
none-after: 100 411 237 bytes +1.76%
### pypy
bzip-before: 201 295 752 bytes
bzip-after: 209 780 282 bytes +4.21%
zstd-before: 202 974 795 bytes
zstd-after: 205 165 780 bytes +1.08%
none-before: 871 070 261 bytes
none-after: 993 595 057 bytes +14.07%
### netbeans
bzip-before: 601 314 330 bytes
bzip-after: 614 246 241 bytes +2.15%
zstd-before: 604 745 136 bytes
zstd-after: 615 497 705 bytes +1.78%
none-before: 3 338 238 571 bytes
none-after: 3 439 422 535 bytes +3.03%
### mozilla-central
bzip-before: 1 493 006 921 bytes
bzip-after: 1 549 650 570 bytes +3.79%
zstd-before: 1 481 910 102 bytes
zstd-after: 1 513 052 415 bytes +2.10%
none-before: 6 535 929 910 bytes
none-after: 7 010 191 342 bytes +7.26%
### mozilla-try
bzip-before: 6 583 425 999 bytes
bzip-after: 7 423 536 928 bytes +12.76%
zstd-before: 6 021 009 212 bytes
zstd-after: 6 674 922 420 bytes +10.86%
none-before: 22 954 739 558 bytes
none-after: 26 013 854 771 bytes +13.32%
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Dec 2022 12:10:31 +0100] rev 49886
bundle: when forcing acceptance of incoming delta also accept snapshot
Snapshot where never considered reusable and the unbundling side always tried
to find a delta from them. In the `forced` mode this is counter-productive
because it will either connect two delta-tree that should not be connected or
it will spend potentially a lot of time because creating a full snapshot
anyway.
So in this mode, we accept the full snapshot as is.
This changeset is benchmarked with its children so please do not split them
apart when landing.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Dec 2022 20:05:19 +0100] rev 49885
delta-find: properly report full snapshot used from cache as such
The number of tries and the delta base is reported differently so we missed
there detection initially.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 07 Dec 2022 22:40:54 +0100] rev 49884
test-acl: glob the payload size again
This size of bundle-2 payload are irrelevant for this test and only appears in
its output because other pieces of the debug output are important.
We glob it these number before they get in our way again.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Nov 2022 15:41:28 -0800] rev 49883
amend: add a --draft option to set phase to draft
Some users create commits in secret phase by default and then want to make them
draft so they can be uploaded. This patch adds a --draft option for that. We
already have a flag for changing the phase to secret, so it seems consistent to
have one for draft.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Nov 2022 13:07:16 -0800] rev 49882
commit: add --draft option to use draft phase
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Nov 2022 14:40:17 -0800] rev 49881
tests: use graph log in test-phases.t
It's hard to tell that the phases are ordered correctly without seeing the
graph.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Nov 2022 13:31:01 -0800] rev 49880
commit: move check for incompatible args earlier
I think it makes sense to check the command line arguments as early as possible,
so we don't have to wait for a repo lock to tell the user that they passed
invalid arguments.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 07 Nov 2022 22:30:30 -0500] rev 49879
delta-find: add a delta-reuse policy that blindly accepts incoming deltas
When this policy is set, incoming deltas are blindly accepted without regard
for the validity of the chain they build.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 01:24:34 +0100] rev 49878
delta-find: add a `delta-reuse-policy` on configuration `path`
That option allows to control the behavior on a per-path basis, opening the way
to treating pulls from central servers differently than other operations.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 01:31:23 +0100] rev 49877
changegroup: add `delta_base_reuse_policy` argument
The argument available through function from changegroup.apply to
`revlog.apply` allow to override the revlog configuration in terms of
delta-base-reuse policy when searching for a delta to store a revision.
It will be put to use in the next changesets.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 01:16:22 +0100] rev 49876
bundleoperation: optionnaly record the `remote` that produced the bundle
We have the information at hand, and the peer now have knownledge of its `path` object, which constaints useful behavior configuration.
So the simpler seems to be to pass that object around so it can be used if
needed.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Dec 2022 03:23:46 +0100] rev 49875
delta-find: add a test checking various simple behavior
There are enough work happening in this area that it is worth having a dedicated
test for it. So far we add to small test checking that the "best" parent is
picked as the delta base and that this behavior can be controlled during commit
and unbundle.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 19:34:01 +0100] rev 49874
peer: pass the `path` to the statichttp peer
We now have all peer able to receive and store a `path` object. Hooray.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 06:16:58 +0100] rev 49873
peer: get the `path` object down to the sshpeer
Same logic as the other peers.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 06:16:45 +0100] rev 49872
logexchange: use the proper accessors to get the remote url
There is an official method, let us use it.
this will prevent a crash when the private attribute disappear.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 00:24:28 +0100] rev 49871
peer: get the `path` object down to the httppeer
One more peer with a path stored.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 05:53:13 +0100] rev 49870
path: fix `url.copy` dropping the port
The copy method have been wrong for a while, but the new code reveals it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 18:19:59 +0100] rev 49869
peer: pass the `path` object to `make_peer`
We don't do anything with it yet, but we can start implementing it for each peer
type starting now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 18:18:57 +0100] rev 49868
path: allow to copy a path while adjusting the url
This will be used by `scheme` in the next changesets.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 00:19:23 +0100] rev 49867
peer: store the path object used to build a peer from a repo
This is the simplest case, we so starts with it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 17:41:44 +0100] rev 49866
peer: build a `path` object on the fly when needed
So now, we always have a `path` object around when building the peer
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 00:16:07 +0100] rev 49865
peer: have `repo.peer` take an optional `path` argument
We are ready to start to actually set the value now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 00:13:50 +0100] rev 49864
peer: add a `path` attribute to peer
It will start being set in the coming changesets.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 00:00:41 +0100] rev 49863
peer: have a common constructor and use it
For now it does not do much, but we will extend it to also store a path object
soon.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 18:04:51 +0100] rev 49862
peer: use a dedicated name for the `peer` constructor
We want to change the argument it takes, so we rather make them different
function.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 18:04:37 +0100] rev 49861
peer: dissolve `_peerlookup` into its last two callers
This is about to need more changes and the function won't be useful. We do it
early to clarify later changes.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 03:45:45 +0100] rev 49860
peer: stop having a `peer()` method on `peer()`
This is already a peer, why do you want a peer if you already have one.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Dec 2022 03:45:39 +0100] rev 49859
clone: explicitly detect the need to fetch a peer
Instead of having `peer()` method on all `peer()` for this usecase, we could
simply handle it explicitly.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 19:15:04 +0100] rev 49858
addbranchrevs: explicitly detect the need to fetch a peer
Instead of having `peer()` method on all `peer()` for this usecase, we could
simply handle it explicitly.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 17:01:54 +0100] rev 49857
path: pass `path` to `peer` in `hg clone`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 16:49:54 +0100] rev 49856
path: use `get_clone_path_obj` in share
The return is simpler to use, and this mean less user for the old function.
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 16:42:36 +0100] rev 49855
path: pass `path` to `peer` in mq
We directly use the `path` object to build the `peer` object.
There is one case where we don't. We should fix that at the same time as we fix
the sub-repo cases.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 16:36:43 +0100] rev 49854
path: use `get_clone_path_obj` in _getlocal
We don't need to feed the `path` object to a `peer` object, but using an higher
level function is simpler here (e.g. no subscript access, explicit attribute
access).
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 16:34:00 +0100] rev 49853
path: pass `path` to `peer` in `hg init`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 16:30:48 +0100] rev 49852
path: add a `get_clone_path_obj` function
Same logic as the `get_unique_pull_path_obj` function, this give access to the
`path` object directly.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 03:56:23 +0100] rev 49851
path: simplify the implementation of `get_clone_path`
We can simply use the logic from `get_unique_pull_path_obj` now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 03:51:27 +0100] rev 49850
path: clarify document of `get_clone_path`
This return a url as `bytes`, not a `path` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:52:27 +0100] rev 49849
path: pass `path` to `peer` in `hg perf::discovery`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:49:39 +0100] rev 49848
path: pass `path` to `peer` in remotefilelog's tests
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:48:17 +0100] rev 49847
path: pass `path` to `peer` in `hg fastannotate`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:45:46 +0100] rev 49846
path: pass `path` to `peer` in infinitepush
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:42:17 +0100] rev 49845
path: pass `path` to `peer` in largefiles
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:38:03 +0100] rev 49844
path: pass `path` to `peer` in narrow
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:37:15 +0100] rev 49843
path: pass `path` to `peer` in `hg fetch`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:33:50 +0100] rev 49842
path: use `get_unique_pull_path_obj` in `hg relink`
This is not really needed, but that help removing caller of the older function.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:31:19 +0100] rev 49841
path: pass `path` to `peer` in `hg transplant`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:29:11 +0100] rev 49840
path: pass `path` to `peer` in `hg debugbackupbundle`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:24:52 +0100] rev 49839
path: pass `path` to `peer` in `hg debugssl`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 06:21:08 +0100] rev 49838
path: pass `path` to `peer` in `hg debugdiscovery`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 05:11:53 +0100] rev 49837
path: pass `path` to `peer` in `remote(...)` revset
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 05:10:05 +0100] rev 49836
path: pass `path` to `peer` in `hg summary`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 04:31:08 +0100] rev 49835
path: pass `path` to `peer` in `hg identify`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 03:50:28 +0100] rev 49834
path: introduce a `get_unique_pull_path_obj` function
Unlike the previous one, `get_unique_pull_path`, this function return the `path`
object, opening more option for the caller.
note that this highlight we don't actually need the `repo` argument to
`get_pull_paths`, however changing the API would be annoying for third party
extensions.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 01:55:05 +0100] rev 49833
path: simplify the `get_unique_pull_path` function
Simply delegate the search to `get_pull_paths` and check how many we got.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 01:41:27 +0100] rev 49832
path: remove outdated documentation point from `get_unique_push_path`
This is no longer true.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 18:41:59 +0100] rev 49831
path: pass `path` to `peer` in `hg pull`
We directly use the `path` object to build the `peer` object.
We don't use it for sub-repositories yet, which will have to be fixed at some
point.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 18:19:08 +0100] rev 49830
path: pass `path` to `peer` in `hg incoming`
We directly use the `path` object to build the `peer` object.
We don't use it for sub-repositories yet, which will have to be fixed at some
point.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 17:55:17 +0100] rev 49829
path: pass `path` to `peer` in `hg incoming` bookmark logic
We directly use the `path` object to build the `peer` object.
Touching this code highlighted that we never honor the branches' information
of when doing bookmark level incoming checks.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 16:58:22 +0100] rev 49828
path: remove outdated documentation point from `get_unique_pull_path`
This is no longer true.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 16:53:22 +0100] rev 49827
path: update `get_unique_pull_path` to point out it returns a url
Unlike other functions in this module it returns a url as `bytes` and
not a `path` object. Let us point it out in the doc.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Dec 2022 02:03:49 +0100] rev 49826
changelog-v2: fix the docket `struct`
The previous definition used `L` which is actually 4 bytes, while the
documentation and intend was to use `Q`, i.e. 8 bytes.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 02:26:34 +0100] rev 49825
path: pass `path` to `peer` in infinite push
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 02:21:18 +0100] rev 49824
path: pass `path` to `peer` in `hg histedit`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 02:14:40 +0100] rev 49823
path: pass `path` to `peer` in the `outgoing` revset
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 02:11:21 +0100] rev 49822
path: pass `path` to `peer` in `hg summary`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 02:09:43 +0100] rev 49821
path: pass `path` to `peer` in `hg outgoing`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:57:14 +0100] rev 49820
path: pass `path` to `peer` in `hg bundle`
We directly use the `path` object to build the `peer` object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 30 Nov 2022 19:43:26 +0100] rev 49819
path: have `peer` constructor accept a `path` object
We don't do anything fancy with it yet, but this is an important step towards
having the peers aware of their "source" and associated configurations.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:46:46 +0100] rev 49818
path: deprecated the `pushloc` attribute
We want to make sure people with use the full featured path "variant".
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:41:34 +0100] rev 49817
path: update logic in `perf` to use the push variant when available
The command seems currently broken, but at least it won't be broken by us !
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:38:33 +0100] rev 49816
path: directly use the push_variant in `infinitepush`
We don't need any extra processing now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:38:07 +0100] rev 49815
path: directly use the push_variant in `hg histedit` outgoing logic
We don't need any extra processing now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:37:41 +0100] rev 49814
path: directly use the push_variant in the `outgoing` revset
We don't need any extra processing now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:37:10 +0100] rev 49813
path: directly use the push_variant in outgoing internals
We don't need any extra processing now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:35:17 +0100] rev 49812
path: directly use the push_variant in `hg summary`
We don't need any extra processing now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:34:58 +0100] rev 49811
path: directly use the push_variant in `hg outgoing`
We don't need any extra processing now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:34:26 +0100] rev 49810
path: directly use the push_variant in `hg push`
We don't need any extra processing now.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:33:27 +0100] rev 49809
path: have `get_push_paths` directly return the push variants
So the function directly returns usable paths, that should help the callers!
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:32:24 +0100] rev 49808
path: add a method to retrieve a "push variant" of a path
This gets you the same path, but using the `pushurl` as destination.
This opens the way for a lot of different improvements, the one which
interests us is having `peer` objects aware of the `path` they came from.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Dec 2022 01:27:47 +0100] rev 49807
path: move the url parsing and related attribute setting to a method
This will make it simpler to reuse this logic in the next changeset.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 29 Nov 2022 22:22:18 +0100] rev 49806
peer-or-repo: remove the now unused function
We do not need it anymore.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 29 Nov 2022 22:21:19 +0100] rev 49805
peer-or-repo: build a repo directly in the `repo` function
We skip the ambiguous _peerorrepo function to explicitly build a repo within
the dedicated function. The peer scheme are therefore no longer considered to
build the object.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 29 Nov 2022 22:04:23 +0100] rev 49804
peer-or-repo: build a peer directly in the `peer` function
We skip the ambiguous _peerorrepo function to explicitly build a peer within
the dedicated function. This mean explicitly getting a peer from an explicitly
create repository when necessary.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 29 Nov 2022 22:03:10 +0100] rev 49803
static-http: have `statichttprepo.instance` return a peer object
It previously returned a statichttprepo object which could not be used for
anything but creating a peer. So lets put it into the peer bucket with a peer
behavior.