Arseniy Alekseyev <aalekseyev@janestreet.com> [Fri, 16 Aug 2024 11:12:19 +0100] rev 51806
sparse: reliably avoid writing to store without a lock
With the code as written before this patch we can still end up writing to
store in `debugsparse`. Obviously we'll write to it if by accident a store
requirement is modified, but more importantly we write to it if another
concurrent transaction modifies the requirements file on disk.
We can't rule this out since we're not holding the store lock,
so it's better to explicitly pass a permission to write instead
of inferring it based on file contents.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 13:52:14 +0100] rev 51805
debugsparse: stop taking the store lock
debugsparse is a workspace-only opperation, or it better be workspace-only.
Let's make it to stop taking the store lock.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 14:54:22 +0100] rev 51804
scmutils: read the requires file before writing to avoid unnecessary rewrite
This lets us get away without the repo lock in situations where we need
to write requirements, but we know we're not changing the store requirements.
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 14:56:50 +0100] rev 51803
localrepo: remove _readrequires function in favor of scmutil.readrequires
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 15 Aug 2024 14:53:17 +0100] rev 51802
scmutil: add `readrequires` next to `writerequires`
The code is copied from localrepo.py.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 14 Aug 2024 03:25:16 -0400] rev 51801
typing: correct a type hint in `mercurial.manifest`
Obvious typo that was flagged by PyCharm.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Aug 2024 14:22:26 -0400] rev 51800
typing: add hints to `mercurial.util.mktempcopy()`
Might as well, now that the previous commit indicated what types are required.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Aug 2024 14:18:44 -0400] rev 51799
typing: fix the hint for the `mode` argument of `platform.copymode()`
The posix module is doing a bitwise AND with this and an integer, so it can't be
bytes. The only caller that provides the argument is `util.mktempcopy()`, and
pytype infers the type as Any, which explains why this wasn't caught.
Manuel Jacob <me@manueljacob.de> [Fri, 09 Aug 2024 22:45:32 +0200] rev 51798
largefiles: fix check that ensures that --all-largefiles is only used locally
Previously, the command added in the test failed with “abort: --all-largefiles is incompatible with non-local destination existing_destination”.
The reason for the buggy behavior was the use of hg.islocal(), which does “return true if repo (or path pointing to repo) is local” and, for local paths, assumes that the path is actually pointing to an existing repository and returns whether the path is not a regular file (in which case it assumes that it is a bundlerepo, which are considered non-local).
Felipe Contreras <felipe.contreras@gmail.com> [Fri, 05 May 2023 06:08:36 -0600] rev 51797
exchange: trivial simplification
Both sides of the condition do essentially the same thing, except one
with fastpath=True.
No functional changes.
Manuel Jacob <me@manueljacob.de> [Fri, 09 Aug 2024 14:26:13 +0200] rev 51796
import: fix erroneous comparison of str with bytes
Anton Shestakov <av6@dwimlabs.net> [Thu, 08 Aug 2024 17:28:38 +0400] rev 51795
histedit: create state and acquire locks earlier
This makes chistedit (histedit with curses UI) not write any files inside repo
without wlock. It also makes sense to wrap the entire process of preparing
commands inside the curses UI inside locks because we don't want anything else
to touch wdir or repo during this time.
Manuel Jacob <me@manueljacob.de> [Tue, 06 Aug 2024 22:51:41 +0200] rev 51794
py3: use str literal instead of bytes literal
Manuel Jacob <me@manueljacob.de> [Tue, 06 Aug 2024 18:23:59 +0200] rev 51793
typing: fix type annotation
Manuel Jacob <me@manueljacob.de> [Tue, 06 Aug 2024 17:53:59 +0200] rev 51792
cffi: pass bytes instead of str to ffi.new("char[]", …)
The type annotations seem to imply that the passed values are always already bytes, but they aren’t necessarily. Before Python 3.11, the documentation stated that bytes can be used to annotate arguments whose type is actually any of bytes, bytearray, or memoryview.
Manuel Jacob <me@manueljacob.de> [Mon, 05 Aug 2024 21:21:32 +0200] rev 51791
cffi: call bytes() instead of str() on CFFI buffer instances
Manuel Jacob <me@manueljacob.de> [Mon, 05 Aug 2024 21:08:36 +0200] rev 51790
cffi: pass C type and attribute names as str instead of bytes
Manuel Jacob <me@manueljacob.de> [Mon, 05 Aug 2024 20:47:17 +0200] rev 51789
py3: fix type of some elements of __all__ lists
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Aug 2024 20:08:23 +0200] rev 51788
manifest: deprecated readdelta and readfast
These method should not have any user left.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Aug 2024 02:09:33 +0200] rev 51787
manifest: use read_delta_new_entries in verify too
This seems like the proper semantic for the usage.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Aug 2024 02:13:17 +0200] rev 51786
manifest: use read_delta_new_entries in changegroup validate
This new method have a well defined semantic and can be adjusted by narrow as it
needs. This should prevent some unwanted filelog access when running validate on
a server using narrow profile to restrict access.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Aug 2024 02:12:08 +0200] rev 51785
manifest: add a read_delta_new_entries method
This new method have a well defined semantic and can be adjusted by narrow as it
needs.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:15:54 +0200] rev 51784
manifest: use `read_delta_parents` when adjusting linkrev
Let's use the more accurate API.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:15:10 +0200] rev 51783
manifest: use the `read_delta_parents` method
Let's use the more accurate API.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:12:49 +0200] rev 51782
manifest: use `read_delta_parents` when adjusting linkrev in remotefile
Let's use the more accurate API.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:10:09 +0200] rev 51781
manifest: introduce a `read_delta_parents` method
This new method have a clearer semantic and can be used by code that need this
semantic. This should avoid bugs, allow for more targeted optimisation, and
provide a clearer API. Users will be updated in subsequent changesets.
This is also part of the wider effort to clarify and fix this API. one more
method coming.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 12:14:40 +0200] rev 51780
manifest: use `read_any_fast_delta` for tag rev cache computation
This will have the benefit of using the fast path more often, and being (a bit)
less buggy. See inline comment for details.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 05:37:57 +0200] rev 51779
manifest: use `read_any_fast_delta` during shallow prefetch's
We now have a better function with a clear semantic. This simplify the usage in
the remotefilelog code.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 05:36:53 +0200] rev 51778
manifest: use `read_any_fast_delta` during remotefilelog's repack
We now have a better function with a clear semantic. This simplify the usage in
the remotefilelog code.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 01 Aug 2024 13:42:34 +0200] rev 51777
manifest: use read_any_fast_delta in changectx
The new API is clearer but also more expressive. It allow to detect case where
we did return a full read and populated the associated cache. Saving time!