Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 12:05:32 +0200] rev 51211
rust-index: add `is_snapshot` method
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Aug 2023 16:49:33 +0200] rev 51210
rust-index: use the Rust index in `partialmatch`
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 14:50:17 +0200] rev 51209
rust-index: add missing special case for null rev
This was an oversight, it was never a problem because we didn't use the index
much for user-facing things in the past, which is the only real way of getting
to this edge case.
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Aug 2023 16:49:17 +0200] rev 51208
rust-index: use the rust index in `shortest`
Raphaël Gomès <rgomes@octobus.net> [Wed, 02 Aug 2023 14:34:21 +0200] rev 51207
rust-index: add checks that `__contains__` is synchronized
Georges Racinet <georges.racinet@octobus.net> [Mon, 30 Oct 2023 11:03:57 +0100] rev 51206
rust-index: using the Rust index in nodemap updating methods
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Nov 2023 11:19:54 +0100] rev 51205
rust-index: implementation of __getitem__
Although the removed panic tends to prove if the full test suite
did pass that the case when the input is a node id does not happen,
it is best not to remove it right now.
Raising IndexError is crucial for iteration on the index to stop,
given the default CPython sequence iterator, see for instance
https://github.com/zpoint/CPython-Internals/blobs/master/BasicObject/iter/iter.md
This was spotted by `test-rust-ancestors.py`, which does simple interations on
indexes (as preflight checks).
In `revlog.c`, `index_getitem` defaults to `index_get` when called
on revision numbers, which does raise `IndexError` with the same message as
the one we are introducing here.
Georges Racinet <georges.racinet@octobus.net> [Wed, 27 Sep 2023 11:34:52 +0200] rev 51204
rust-index: optim note for post-scaffolding removal
Raphaël Gomès <rgomes@octobus.net> [Thu, 02 Nov 2023 11:16:13 +0100] rev 51203
rust-index: check that the entry bytes are the same in both indexes
This is a temporary measure to show that both the Rust and C indexes are
kept in sync.
Comes with some related documentation precisions.
For comparison of error cases, see `index_entry_binary()` in `revlog.c`.
Georges Racinet <georges.racinet@octobus.net> [Sat, 30 Sep 2023 16:15:56 +0200] rev 51202
rust-index: return variables systematic naming convention
To help knowing at a glance when a method is ready, making
us more comofortable when we are close to the final removal of
scaffolding, we introduce the systematic variable names `rust_res` and
`c_res`. The goal of this series is to always return the formet.
We take again the case of `pack_header` as example.
Our personal opinion is to usually avoid such poor semantics as `res`, but
usually accept it when it close to the actual return, which will be the
case in most methods of this series. Also, the name can simply be dropped
when we remove the scaffolding. To follow on the example, the body of
`pack_header()` should become this in the final version:
```
let index = self.index(py).borrow();
let packed = index.pack_header(args.get_item(py, 0).extract(py)?);
Ok(PyBytes::new(py, &packed).into_object());
```
in these cases it is close to the actual return and will be removed
at the end entirely.
Georges Racinet <georges.racinet@octobus.net> [Fri, 29 Sep 2023 15:51:49 +0200] rev 51201
rust-index: results comparison helper with details
This is a bit simpler to call and has the advantage of systematically log
the encountered deviation.
To avoid committing dead code, we apply it to the `pack_header` method, that
was already returning the Rust result.
Georges Racinet <georges.racinet@octobus.net> [Wed, 27 Sep 2023 10:59:04 +0200] rev 51200
rust-index: helper for revision not in index not involving nodemap
This is a good match for exceptions raised from the C implementation,
when it is not about a nodemap inconsistency.
Georges Racinet <georges.racinet@octobus.net> [Wed, 18 Oct 2023 19:54:18 +0200] rev 51199
rust-index: renamed nodemap error function for rev not in index
The function name was misleading, as the error wording mentions the
nodemap, hence would not be appropriate for missing revisions not
related to a nodemap lookup.
Raphaël Gomès <rgomes@octobus.net> [Thu, 03 Aug 2023 10:28:10 +0200] rev 51198
rust-index: add `pack_header` support
Raphaël Gomès <rgomes@octobus.net> [Mon, 30 Oct 2023 10:34:48 +0100] rev 51197
rust-index: support cache clearing
I'm not 100% sure how useful it is outside of perf, but it's still worth
implementing.
Raphaël Gomès <rgomes@octobus.net> [Thu, 29 Jun 2023 11:37:19 +0200] rev 51196
rust-index: check rindex and cindex return the same get_rev
This is a temporary safeguard while we synchronize both indexes.
Raphaël Gomès <rgomes@octobus.net> [Wed, 28 Jun 2023 16:43:39 +0200] rev 51195
rust-index: synchronize remove to Rust index
Future steps will bring the two indexes further together until we can
rip the C index entirely when running Rust code.
Raphaël Gomès <rgomes@octobus.net> [Wed, 28 Jun 2023 11:59:43 +0200] rev 51194
rust-index: remove `__setitem__` method from the mixed index
This is not defined on the Python or C one, and isn't used anywhere.
Raphaël Gomès <rgomes@octobus.net> [Wed, 28 Jun 2023 11:36:22 +0200] rev 51193
rust-index: check equality between rust and cindex for `__len__`
Raphaël Gomès <rgomes@octobus.net> [Tue, 27 Jun 2023 18:24:54 +0200] rev 51192
rust-index: synchronize append method
We now append to the Rust index just as we do to the C index. Future steps
will bring the two indexes further together until we can rip the C index
entirely when running Rust code.
Raphaël Gomès <rgomes@octobus.net> [Mon, 18 Sep 2023 17:11:11 +0200] rev 51191
rust-revlog: teach the revlog opening code to read the repo options
This will become necessary as we start writing revlog data from Rust.
Raphaël Gomès <rgomes@octobus.net> [Tue, 27 Jun 2023 17:34:51 +0200] rev 51190
rust-index: pass data down to the Rust index
This will allow us to start keeping the Rust index synchronized with the
cindex as we gradually implement more and more methods in Rust. This will
eventually be removed.
Raphaël Gomès <rgomes@octobus.net> [Tue, 27 Jun 2023 16:32:09 +0200] rev 51189
rust-index: add append method
This is the first time the Rust index has any notion of mutability.
This will be used in a future patch from Python, to start synchronizing the
Rust index and the C index.
Raphaël Gomès <rgomes@octobus.net> [Mon, 26 Jun 2023 19:16:07 +0200] rev 51188
rust-index: add an abstraction to support bytes added at runtimes
In order to support appending data to the Rust index, we need to abstract
data access away from the immutable (on-disk) bytes, to seemlessly fetch
either from the preexisting data or from the newly added data.
Raphaël Gomès <rgomes@octobus.net> [Thu, 29 Jun 2023 16:09:57 +0200] rev 51187
rust-mixed-index: move the mmap keepalive into a function
The same code will be used for keeping the new index mmap around.
Raphaël Gomès <rgomes@octobus.net> [Thu, 29 Jun 2023 15:00:46 +0200] rev 51186
rust-mixed-index: rename variable to make the next change clearer
We're going to add another mmap reference holder, so let's rename this one
first.
Georges Racinet <georges.racinet@octobus.net> [Wed, 27 Sep 2023 10:08:32 +0200] rev 51185
rust: fix cargo doc for hg-cpython
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Dec 2023 11:10:24 +0100] rev 51184
branching: merge with default
We merge with the current children of the bad merge (
37b52b938579)
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Dec 2023 11:08:41 +0100] rev 51183
branching: merge with stable
This recreates `
37b52b938579` right as a `hg branch --rev
5b186ba40001` screwed
up the content.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Dec 2023 02:07:16 +0100] rev 51182
changelog: disallow delayed write on inline changesets
Since this will never happens, we can make the situation invalid and to stop to
handling the associated the case.
This simplify the random access file reading too.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Dec 2023 22:27:59 +0100] rev 51181
changelog: never inline changelog
The test suite mostly use small repositories, that implies that most changelog in the
tests are inlined. As a result, non-inlined changelog are quite poorly tested.
Since non-inline changelog are most common case for serious repositories, this
lack of testing is a significant problem that results in high profile issue like
the one recently fixed by
66417f55ea33 and
849745d7da89.
Inlining the changelog does not bring much to the table, the number of total
file saved is negligible, and the changelog will be read by most operation
anyway.
So this changeset is make it so we never inline the changelog, and de-inline the
one that are still inlined whenever we touch them.
By doing that, we remove the "dual code path" situation for writing new entry to
the changelog and move to a "single code path" situation. Having a single
code path simplify the code and make sure it is covered by test (if test cover
that situation obviously)
This impact all tests that care about the number of file and the exchange size,
but there is nothing too complicated in them just a lot of churn.
The churn is made "worse" by the fact rust will use the persistent nodemap on
any changelog now. Which is overall a win as it means testing the persistent
nodemap more and having less special cases.
In short, having inline changelog is mostly useless and an endless source of
pain. We get rid of it.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Dec 2023 11:50:55 +0100] rev 51180
test-transaction-safety: glog out irrelevant flag
The test is focussing on the inline flag, so we glob out the other to highlight
that fact and prevent noise in the future.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 11 Dec 2023 11:43:32 +0100] rev 51179
test-transaction-safety: perform the test on a filelog
This test previously checked the transaction safety of splitting the changelog.
The changelog is a special case, with delayed/diverted writes and we will stop
inlining it soon. So we keep testing that transaction is safe around inline on
another revlog type : a filelog.
Minor comestic adjustement will be done in the next changesets.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Dec 2023 03:40:37 +0100] rev 51178
test: clarify test-parseindex offsets
We will make this revlog non-inline, so we clarify the code to make sure it is
simple to adjust the test later.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Dec 2023 06:05:18 +0100] rev 51177
test: use more globing for perf timing
Not sure why we kept the number here.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Dec 2023 12:29:12 +0100] rev 51176
branching: merge with stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Dec 2023 03:49:48 +0100] rev 51175
persistent-nodemap: avoid writing nodemap for empty revlog
The format cannot encode the lack of tip_rev.
There is currently nothing known to write such empty nodemap right now, but the
change we are preparing on default reveal this issue. So I had rather fix it on
stable.
Julien Cristau <jcristau@mozilla.com> [Tue, 12 Dec 2023 11:47:48 +0100] rev 51174
histedit: remove superfluous echo() and endwin() calls (
issue6859)
ncurses patchlevel
20231111 started returning an error from endwin() if
called twice without a intervening screen update.
Per Sven Joachim in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058041#17: "AFAICS,
invoking curses.echo() and curses.endwin() is superfluous
because curses.wrapper already does that for you, and calling
curses.endwin() twice throws an error with the newer ncurses. Removing
those two lines should fix the problem."
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Dec 2023 09:31:07 -0800] rev 51173
statprof: handle `lineno == None` in more cases
This continues the work from
972f3e5c94b8. We saw a crash on line 956 but I
updated lots of other places as well.
Raphaël Gomès <rgomes@octobus.net> [Thu, 07 Dec 2023 14:28:31 +0100] rev 51172
branching: merge stable into default
Raphaël Gomès <rgomes@octobus.net> [Thu, 07 Dec 2023 14:22:55 +0100] rev 51171
Added signature for changeset
71bd09bebbe3
Raphaël Gomès <rgomes@octobus.net> [Thu, 07 Dec 2023 14:22:46 +0100] rev 51170
Added tag 6.6.1 for changeset
71bd09bebbe3
Raphaël Gomès <rgomes@octobus.net> [Thu, 07 Dec 2023 14:19:02 +0100] rev 51169
relnotes: add 6.6.1
Anton Shestakov <av6@dwimlabs.net> [Sat, 02 Dec 2023 15:10:28 -0300] rev 51168
procutil: move stdin assignment outside of try-finally block
There is an stdin variable in the global scope of this module. And in the
`finally` block of this try-finally statement we're checking `if stdin is not
None`. Let's make sure we don't confuse code check tools into thinking we want
to use global stdin by moving this line of code outside of `try`.
This was caught by pytype 2023.11.21 on Python 3.11.2.
Anton Shestakov <av6@dwimlabs.net> [Sat, 02 Dec 2023 15:02:03 -0300] rev 51167
zeroconf: give inet_aton() str instead of bytes
All other uses of this function in this extension are already fixed (i.e. use
strings instead of bytes).
This was caught by pytype 2023.11.21 on Python 3.11.2.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Dec 2023 16:29:43 +0100] rev 51166
revlog: avoid wrongly updating the data file location on "divert"
If we are in the inline case, we need to align the location of the "data" file
with the temporary location of the file (i.e. "00changelog.i.a"). However we
should not do that for non-inline case… and before this changeset we had been
doing it. In addition `index_file` is already a property taking care of updating
the "segment file" filename when needed. So we can simply remove all that code.
As a result, code trying to read the diverted data before they were committed
ended deeply confused as the "00changelog.i.a" file is nothing like the
"00changelog.d" file.
However nothing corrupted data as all writing where properly handled outside of
the "segment file".
In "best" cases this small in-memory corruption of the filename when unnoticed
until the transaction was committed or rolled back and in the worse case, some
data reading was failing during the transaction and resulted in the transaction
to be rolled back. However wrong data never reached the disk, so this bug should
be have corrupted any repository.
This is not catch by tests because most test use a small repository and
therefor an inline revlog. In addition the bug only triggers when a
changelog read is done in the following "rare" situation:
- after some delayed write
- after that data have been written in a "divert" file (i.e. `00.changelog.i.a`)
- before transaction commit
- outside of a "writing" context
The issue was introduced in
d83d788590a8
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 07 Dec 2023 00:34:08 +0100] rev 51165
revlog: avoid exposing delayed index entry too widely in non-inline revlog
Before this change, the index entry would be seen as "appended" to the data
file. It did not hurt too much as there are never accessed for reading, but this
was odd. So lets stop doing so.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 06 Dec 2023 15:38:15 +0100] rev 51164
revlog: add one more assert about state of thing when splitting
This assert is currently happy, but it does not hurt to adds it to clarify
expected state and catch potential error in the future.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Nov 2023 08:32:24 -0800] rev 51163
add: don't attempt to add back removed files unless explicitly listed
This fixes the bug demonstrated by the previous patch.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 28 Nov 2023 22:44:04 -0800] rev 51162
tests: show failure to `hg add -I` a dir->symlink transition
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 11 Apr 2023 21:56:16 +0200] rev 51161
setup: try a non-pure version of the local Mercurial if the pure fails
Things like `zstd` can make the pure version fails.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 01 Dec 2023 22:13:37 +0100] rev 51160
setup: make debug simpler by adding a `__repr__` to `hgcommand`
This help when trying to debug this logic.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 02 Dec 2023 02:13:23 +0100] rev 51159
censor: fix things around inlining
The temporary revlog cannot go through the inline → split process as this would
break at transaction commit. (that might be fixable, but lets keep things
simple for now). We introduce a cleaner way to enforce this as the previous one
was broken in 6.6
On the way we remove multiple weird, fragile and broken overwrite of revlog
attributes and we focus on passing the configuration across.
We also had to update the test to actually create a non-inline revlog.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 02 Dec 2023 02:12:21 +0100] rev 51158
revlog: add a `may_inline` argument to revlog
This allow for a clean skipping of the inline feature when needed, for example
by censor.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 02 Dec 2023 02:11:20 +0100] rev 51157
revlog: allow explicit passing of config to revlog
This will be useful to fix censor in a later changeset.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 02 Dec 2023 01:06:35 +0100] rev 51156
censor: show that the `not-inline` → `inline` test is broken
The source revlog should not be inlined and it is…
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 15 Nov 2023 18:43:03 +0000] rev 51155
rhg: support rhg status --rev --rev
Arseniy Alekseyev <aalekseyev@janestreet.com> [Wed, 15 Nov 2023 18:41:33 +0000] rev 51154
rust: add a utility function to merge ordered fallible iterators
Adding a function merge_join_results_by, a version of
itertools::merge_join_by that works on "fallible" iterators
(iterators that can produce errors)
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 16 Oct 2023 18:56:40 +0100] rev 51153
rhg: refactor hg status, make the display code usable for non-dirstate status
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 03 Dec 2023 04:49:49 +0100] rev 51152
perf-tags: fix clear_cache_fnodes to actually clear that cache
The function was not doing it what it advertise for a long time. So we fix it
and we add a way for the perf extensions to detect broken version.
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 03 Dec 2023 04:43:08 +0100] rev 51151
perf-tags: fix the --clear-fnode-cache-rev code
It seems like this code never run?
Arseniy Alekseyev <aalekseyev@janestreet.com> [Mon, 04 Dec 2023 17:20:31 +0000] rev 51150
tests: do not fail tests in a state with uncommitted .py file removal
The problem is that [hg locate] lists removed files too.
We use [hg files] instead because that does not list removed files.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 02 Dec 2023 00:52:37 -0500] rev 51149
tests: fill in the Windows pattern for `$EADDRNOTAVAIL$` matching
This fixes test-https.t on Windows.
It looks like the real error translation is "Cannot assign requested address.",
and the message here is the start of a longer description, so I'm not sure why
this part is emitted. But it's not worth digging into, as it's evidently the
same failure.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 02 Dec 2023 00:34:44 -0500] rev 51148
tests: avoid a cascading failure on Windows
The `identify --debug` command here on Windows emits
skip updating dirstate: identity mismatch
because of the debug switch, which got captured and added to `.hgtags`, and then
hijinx ensued. The point of `--debug` seemed to be to get the long hash, so
just do that with templating. I have not idea if the message is indicating a
problem- there seems to be many more of them in other tests that are not present
on Linux.