Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 18:56:31 +0100] rev 51338
delta-find: split the generic part of `_pre_filter_rev` in a method
Since `_pre_filter_rev` contains logic from various sources of constraint, we
start splitting is in subfunction to clarify and document the grouping.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 04 Jan 2024 14:39:10 +0100] rev 51337
delta-find: drop the temporary indent
Now that the complicated change is made, we can do the noisy one.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 18:40:47 +0100] rev 51336
delta-find: move pre-filtering of individual revision in its own function
This goes one step further than the previous change by making the pre-filtering
of individual candicates revision in its own function. This will allow subclass
to easily configure this filtering with their own constrains.
The `if True:` part help the readability of this diff a lot and will be drop in
to the next changesets.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 04:21:07 +0100] rev 51335
delta-find: move pre-filtering of candidates in its own function
This organise the code further and open the way to specialization via
sub-classing. Something important for the coming changes.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 29 Dec 2023 13:35:08 +0100] rev 51334
delta-find: move away from the generator API for _DeltaSearch
We use more explicit function call. This make operations more explicit and will
make future refactoring simpler.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 21:13:14 +0100] rev 51333
delta-find: use "-1" as depth snapshot-dept for non snapshot in debug
This will help do distinct full snapshot (level 0) and normal delta (not a snapshot, no snapshot level)
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 21:45:45 +0100] rev 51332
delta-find: fix the computation of the `prev` value
The previous computation was "wrong" it always used the tiprev, even when computing a delta in a non-append case (mostly benchmark).
This never produced wrong delta on disk, but would misled debug or performance command. Since it does not have any actual user impact, I did not put this on stable.
With the code fixed we can now use revisions in some search and it makes the
test display more interesting behavior since the algorithm has more to work
with.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 22 Dec 2023 01:33:40 +0100] rev 51331
delta-find: move is_good_delta_info on the _DeltaSearch class
There is a lot of format specific code in `is_good_delta_info`, moving it on
_DeltaSearch will allow to split this into subclass soon.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 22 Dec 2023 01:33:33 +0100] rev 51330
delta-find: feed revinfo to _DeltaSearch
The revinfo has more information and will allow for even more function to be
turned into method.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 03:23:11 +0100] rev 51329
delta-find: clarify that revisioninfo.p1/p2 constains nodeid
This clarify the content of these attributes.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 03:23:41 +0100] rev 51328
delta-find: move filing of some debug data in `_one_dbg_data`
Since the `_one_dbg_data` method is meant to create a valid debug dictionnary.
We can as well prefill the relevant value to reduce the amount of debug code in
the main code.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 01:28:30 +0100] rev 51327
delta-find: add more explanation to the the deltas_limit < length check
More explanations is always good.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 23 Nov 2023 01:13:40 +0100] rev 51326
delta-find: move tested in the _DeltaSearch.__init__
Now that we have an object we can initialize that attribute at initialization
time. This will make it available for more method in the future, allowing to
split the code.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 05:05:29 +0100] rev 51325
delta-find: check DELTA_BASE_REUSE_FORCE in the _DeltaSearch.__init__
Now that we have an object we can check that DELTA_BASE_REUSE_FORCE cases does not reach this code at in a more suitable location.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 05:04:23 +0100] rev 51324
delta-find: move target_rev in the _DeltaSearch.__init__
Now that we have an object we can initialize that attribute at initialization
time.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 05:03:21 +0100] rev 51323
delta-find: move snapshot_cache in the _DeltaSearch.__init__
Now that we have an object we can initialize that attribute at initialization
time.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 04:59:25 +0100] rev 51322
delta-find: move `_rawgroups` on the `_DeltaSearch` object
Moving more code before doing more logic changes.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 04:53:11 +0100] rev 51321
delta-find: move `_refinedgroups` on the `_DeltaSearch` object
Moving more code before doing more logic changes.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 20 Nov 2023 04:44:40 +0100] rev 51320
delta-find: introduce a _DeltaSearch object
That object represent the search of a good delta for one revision. It will
replace the interleaved generator currently in use. It will make the logic more
explicit and easier to split into different subclass for the algorithm variant.
We will move content gradually before doing deeper rework.
For now, we only move the `_candidategroups` function here. More will follow in
the same series.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 22 Dec 2023 12:58:54 +0100] rev 51319
delta-find: add a small docstring to deltacomputer
As we are about to introduce another object related to finding delta. So lets
have a minimal docstring to the existing one.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 11 Jan 2024 16:41:54 +0100] rev 51318
revlog: stop using `atomictmp` for the split revlog
Since we already manually deal with writing on the side and delaying visibily,
we no longer need this.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 11 Jan 2024 16:39:31 +0100] rev 51317
changelog: drop the side_write argument to revlog splitting
The only user is now gone.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 11 Jan 2024 16:35:52 +0100] rev 51316
changelog: stop useless enforcing split at the end of transaction
Changelogs are no longer created inline, and existing changelogs are
automatically split. Since we now enforce splitting at the start of any write,
we don't need to enforce splitting at the end of the transaction.
This has the nice side effect of killing the only user of "side_write".
Anton Shestakov <av6@dwimlabs.net> [Sun, 14 Jan 2024 16:03:08 -0300] rev 51315
tests: don't use "status" operand of dd in test-censor.t (
issue6858)
Some implementations don't have this operand, let's just direct stderr into
/dev/null, that's pretty cross-platform.
Also specify bs=512 (the default for me), because the default might be
different on different systems. Other uses of dd in the tests do specify it, so
this is more consistent.
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:52:13 +0100] rev 51314
branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:49:51 +0100] rev 51313
Added signature for changeset
136902b3a95d
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:49:37 +0100] rev 51312
Added tag 6.6.2 for changeset
136902b3a95d
Raphaël Gomès <rgomes@octobus.net> [Thu, 11 Jan 2024 17:49:04 +0100] rev 51311
relnotes: add 6.6.2
Georges Racinet <georges.racinet@octobus.net> [Wed, 03 Jan 2024 18:33:39 +0100] rev 51310
pycompat: fix bytestr(bytes) in Python 3.11
In Python 3.10, the `bytes` type itself does not have a `__bytes__`
attribute, but it does in 3.11. Yet `bytes(bytes)` does not give
the wished output, so we have to add an exceptional case.
The added case in the doctest reproduces the problem with Python 3.11.
Impact: error treatment in expressions such as `repo[b'invalid']` gets
broken.
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Thu, 04 Jan 2024 14:45:31 -0500] rev 51309
narrow: prevent removal of ACL-defined excludes
Arun Kulshreshtha <akulshreshtha@janestreet.com> [Thu, 04 Jan 2024 14:41:18 -0500] rev 51308
narrow: add test demonstrating bug in acl exclusion enforcement
Anton Shestakov <av6@dwimlabs.net> [Mon, 08 Jan 2024 13:35:02 +0100] rev 51307
contrib: add a set of scripts to run pytype in Docker
Having a simple way to run pytype for developers can massively shorten
development cycle. Using the same Docker image and scripts that we use on our
CI guarantees that the result achieved locally will be very similar to (if not
the same as) the output of our CI runners.
Things to note: the Dockerfile needs to do a little dance around user
permissions inside /home/ci-runner/ because:
- on one hand, creating new files on the host (e.g. .pyi files inside .pytype/)
should use host user's uid and gid
- on the other hand, when we run the image as uid:gid of host user, it needs to
be able to read/execute files inside the image that are owned by ci-runner
Since local user's uid might be different from ci-runner's uid, we execute this
very broad chmod command inside /home/ci-runner/, but then run the image as the
host user's uid:gid.
There might be a better way to do this.
Anton Shestakov <av6@dwimlabs.net> [Mon, 18 Dec 2023 15:52:17 -0300] rev 51306
pytype: use "$(hg root)" instead of `hg root` to make shellcheck happier
Anton Shestakov <av6@dwimlabs.net> [Mon, 18 Dec 2023 15:40:48 -0300] rev 51305
pytype: update check-pytype.sh to select target automatically
We have python3.11 on CI, so we can run pytype targeting that version. On the
other hand, we don't have python3.7 on CI anymore, so we can't run pytype for
3.7 anymore (interpreter not found). I think it's fine to make pytype select
the appropriate target depending on the version of the interpreter it's running
under.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:54:52 +0100] rev 51304
git-hgext: adjust to the lack of `changelog.heads` method
We don't have a `heads` method returning nodeid, but this is very easy to get
the same result.
This was flagged by pytype.
We can note that the fact this code did not break is probably a good sign that
it is dead code.
However this is a question outside of the scop of this series.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:21:31 +0100] rev 51303
remotefilelog: drop dead code
As pytype flagged bug in this method it highlighted that this methode being
never called anywhere.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:07:59 +0100] rev 51302
pytype: use the right signature for the `__delitem__`
It is not because it is NotImplemented that it should use a bad signature. Fix
it to please pytype.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:07:21 +0100] rev 51301
pytype: use the right signature for the `__setitem__`
It is not because it is NotImplemented that it should use a bad signature. Fix
it to please pytype.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:03:34 +0100] rev 51300
sparse: use with statement for wlock
This will avoid pytype complaining about the try/except range.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 22:00:47 +0100] rev 51299
remotefilelog: adjust the signature of basepack.createindex
pytype point that the subclass signature have been updated.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 21 Dec 2023 00:19:19 +0100] rev 51298
pytype: add the couple annotations for pytype to understands the lrunode
After loosing 2d6 SAN, I eventually understood that pytype was confused by method
return type. Pytype is now happy.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:40:06 +0100] rev 51297
pytype: ignore some signature mismatch in registrar
pytype is grumpy about a sub method having a different signature than the one we
use here.
pytype error:
internalmerge: Overriding method signature mismatch [signature-mismatch]
Base signature: 'def _funcregistrarbase._extrasetup(self, name, func) -> Any'.
Subclass signature: 'def internalmerge._extrasetup(self, name, func, mergetype, onfailure = None, precheck = None, binary = False, symlink = False) -> Any'.
Parameter 'mergetype' must have a default value.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:38:46 +0100] rev 51296
hgweb: update _runwsgi try/except range to be valid
The `tmpl` variable is used in the `except` and `finally`, so we need it created
before the `try` is open.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:36:52 +0100] rev 51295
pytype: add type information for `annotateresult.lines`
This seems to appease a confused pytype.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:34:47 +0100] rev 51294
pytype: ignore attribute error for time.clock
This seems to be a Windows only attribute.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:27:49 +0100] rev 51293
pytype: ignore certifi import error
This is an optional import so we should not complains about it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:26:30 +0100] rev 51292
pytype: ignore some signature mismatch in configitems
pytype is grumpy about the dict.update having a more complex signature than the
one we use here.
pytype error:
itemregister: Overriding method signature mismatch [signature-mismatch]
Base signature: 'def builtins.dict.update(self) -> None'.
Subclass signature: 'def itemregister.update(self, other) -> Any'.
Parameter 'other' must have a default value.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 16:30:32 +0100] rev 51291
pytype: only output the "pytype crashed" message on error
If pytype did not crash while generating stub, that message is kind of
confusing. It seems simple enough to avoid it in this case.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 22:17:03 +0100] rev 51290
pytype: drop the now useless assert
As the imported types are now used by type annotation, these ugly assert are
no longer needed.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 16:39:03 +0100] rev 51289
pytype: drop the last inline type comment
We can't assign type to the "for" variant on the fly, so we type the variable
and method used instead.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 11:23:09 +0100] rev 51288
pytype: convert type comment for inline variable too
Same logic as for the previous changeset, but for "type comment" annotating
variables, not function/method.
As for the previous changeset, we had to adjust for of the types to actually match what was happening.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 19 Dec 2023 21:29:34 +0100] rev 51287
pytype: move some type comment to proper annotation
We support direct type annotations now, while pytype is starting to complains
about them.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 20:13:22 +0100] rev 51286
lock: properly convert error to bytes
Flagged by pytype when a later changeset is applied moving typing comment to annotation.
We fix this ahead of the annotation change to make sure pytype remains happy
after the change.
We have to do fairly crazy dance for pytype to be happy. This probably comes
from the fact IOError.filename probably claims to be `str` while it is actually
`bytes` if the filename raising that `IOError` is bytes.
At the same time, `IOError.strerror` is consistently `str` and should be passed
as `str` everywhere.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 20 Dec 2023 12:51:20 +0100] rev 51285
pytype: import typing directly
First we no longer needs the pycompat layer, second having the types imported in
all case will allow to use them more directly in type annotation, something
important to upgrade the old "type comment" to proper type annotation.
A lot a stupid assert are needed to keep pyflakes happy. We should be able to
remove most of them once the type comment have been upgraded.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 08 Nov 2023 01:58:16 +0100] rev 51284
usage: configure uncompressed chunk cache through resource configuration
Let's use this new concept for what it is meant for.
This provides a sizable speed up for reading multiple revision for some complexe
repositories.
### data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog
# benchmark.name = hg.perf.read-revisions
# benchmark.variants.order = reverse
memory-medium: 1.892400
memory-high: 1.722934 (-8.61%)
# benchmark.variants.order = default
memory-medium: 1.751542
memory-high: 1.589340 (-9.49%)
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Oct 2023 15:12:16 +0200] rev 51283
usage: add configuration option to adjust resources usage
They currently do nothing, but this open the way to actually use them.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Oct 2023 15:06:21 +0200] rev 51282
usage: add a `usage.repository-role` config
This config will be used for behavior and performance adjustment depending of
the repository role.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Dec 2023 13:46:28 +0100] rev 51281
common-pattern: cover "elapsed time" line
These are perfect targets for the common-pattern matching.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Dec 2023 18:02:26 +0100] rev 51280
bundle: do not detect --base argument that match nothing as lack of argument
With the previous version of the code, if --base did not match anything, it will
be handled as if no --base was provided and will fallback to using discovery
with the default path. This has two issues :
- The resulting bundle won't match what the user requested,
- if not default path is configured, it will crash.
We now properly distinct between the two cases and if the --base query does not
find any changeset, we will assume that everything under --rev needs to be sent.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 27 Dec 2023 18:42:13 +0100] rev 51279
bundle: highlight misbehavior when --base does not match any revision
See next changeset for fix and details.