Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 15:24:15 -0800] rev 46279
shelve: open patch using new shelf class instead of open()
For some reason the existing code didn't use `shelvedfile().opener()`
so here we migrate to `shelf().open_patch()` from the `open()` system
call instead.
Differential Revision: https://phab.mercurial-scm.org/D9706
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 14:48:57 -0800] rev 46278
shelve: move function for opening .patch file to new shelf class
The `opener()` method was used specifically for the `.patch` file, and
the new `Shelf` class deals with all files involved in a shelf, so I
renamed the function in the process.
Differential Revision: https://phab.mercurial-scm.org/D9705
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 13:57:21 -0800] rev 46277
shelve: move method for reading .hg to new shelf class
Differential Revision: https://phab.mercurial-scm.org/D9704
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 11:25:39 -0800] rev 46276
shelve: move method for writing bundle to new shelf class
Differential Revision: https://phab.mercurial-scm.org/D9703
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 11:28:41 -0800] rev 46275
shelve: move method for reading .shelve file to new shelf class
Differential Revision: https://phab.mercurial-scm.org/D9702
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 11:22:21 -0800] rev 46274
shelve: move method for writing .shelve to new shelf class
Differential Revision: https://phab.mercurial-scm.org/D9701
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 11:07:21 -0800] rev 46273
shelve: introduce class representing a shelf
I'm about to make phase-based shelve not write `.hg` and `.patch`
files. Having a class that represents a single shelf, regardless of
which files it uses will help. I'm starting small with just a
`.exists()` function. I plan to eventually remove the `shelvedfile`
class once all functionality has been moved to the new class.
By the way, I know that things you shelve are not typically themselves
shelves. I still picked `Shelf` for the class because it's short
(compared to e.g. `ShelvedChange`).
Differential Revision: https://phab.mercurial-scm.org/D9700
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 12:26:32 -0800] rev 46272
shelve: raise more specific errors
Differential Revision: https://phab.mercurial-scm.org/D9699
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 12:58:43 -0800] rev 46271
shelve: trust caller of shelvedfile.opener() to check that the file exists
The only place we call `shelvedfile.opener()` is when we're about to
apply a bundle. The file should always exist. If it doesn't, the
`.hg/` directory is corrupt and we don't provide any guarantees about
supporting corrupt repos (besides, telling the user that the shelve
doesn't exist when `hg shelve --list` lists it is not very helpful).
Differential Revision: https://phab.mercurial-scm.org/D9698
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 12:22:39 -0800] rev 46270
shelve: rewrite check for unknown shelf to delete
The code would try to delete the shelf's .patch file and if that
raised an exception, it would convert it to an `error.Abort`. This
patch rewrites it so the check is done upfront. I find it easier to
read that way. It's now clear enough that I removed the comment
explaining it as well.
As Joerg pointed out during review, another differences is that the
old code would move a `.hg` file without its `.patch` friend to backup
before it realized that the `.patch` file was missing. The new code
will error out earlier and not move the `.hg` file, which seems like
an improvement. That should only matter on corrupt `.hg/shelved/`
directories, however.
Differential Revision: https://phab.mercurial-scm.org/D9697
Martin von Zweigbergk <martinvonz@google.com> [Thu, 07 Jan 2021 12:37:14 -0800] rev 46269
shelve: remove a bundlerepo method
It was added in 43816070284e (shelve: add a bundlerepo method,
2014-10-10), but I haven't been able to find a place it was used.
Differential Revision: https://phab.mercurial-scm.org/D9696
Martin von Zweigbergk <martinvonz@google.com> [Fri, 08 Jan 2021 16:38:41 -0800] rev 46268
tests: add tests for corrupt .hg/shelved/ directory
I don't care much how we behave in these cases, except that we should
provide a way for the user to get out of the broken state.
Differential Revision: https://phab.mercurial-scm.org/D9718
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 18:29:19 +0100] rev 46267
ui: add a "config_default" method
This allow code to access the expected value for a config. This is useful in the
context of dynamic default value, and short term it will be useful to write
dynamically "correct" code.
Differential Revision: https://phab.mercurial-scm.org/D9759
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 11:46:30 +0100] rev 46266
test: split tests/test-merge-combination.t into multiple parts
That test is quite slow, lets split it in smaller bits.
Differential Revision: https://phab.mercurial-scm.org/D9768
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 11:33:09 +0100] rev 46265
test: extract the `genmerges` out of test-merge-combination.t
This open the way to splitting this slow test in multiple ones.
Differential Revision: https://phab.mercurial-scm.org/D9767
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 15 Jan 2021 14:05:32 +0100] rev 46264
hghave: clarify `sqlite` requirements
We need more than the python module, we also need the sqlite3 command line.
Differential Revision: https://phab.mercurial-scm.org/D9787
Joerg Sonnenberger <joerg@bec.de> [Fri, 15 Jan 2021 01:21:58 +0100] rev 46263
localrepo: fix comment typo
Differential Revision: https://phab.mercurial-scm.org/D9782
Martin von Zweigbergk <martinvonz@google.com> [Thu, 14 Jan 2021 11:53:55 -0800] rev 46262
error: use detailed exit code 10 for command errors
Command errors (unknown or ambiguous commands, or bad command
arguments or options) are handled in the `dispatch` module. Most other
errors are handled in the `scmutil` module. This patch therefore has
to duplicate a little bit of code from the `scmutil` module. It's just
a few lines, however, so it seems fine to me. It's a pretty common
category of errors, so it's important to have them respect
`ui.detailed-exit-code`.
Differential Revision: https://phab.mercurial-scm.org/D9777
Martin von Zweigbergk <martinvonz@google.com> [Wed, 13 Jan 2021 22:37:21 -0800] rev 46261
errors: raise InputError when non-existent help section requested
Differential Revision: https://phab.mercurial-scm.org/D9776
Augie Fackler <augie@google.com> [Fri, 15 Jan 2021 12:56:25 -0500] rev 46260
revlog: migrate from PyEval_CallObject to PyObject_Call
The former was deprecated in 3.9.0.
Differential Revision: https://phab.mercurial-scm.org/D9791
Augie Fackler <augie@google.com> [Fri, 15 Jan 2021 12:52:52 -0500] rev 46259
fuzz: fix Makefile default PYTHON_CONFIG_FLAGS to be modern
This is actually what we already do on oss-fuzz, so it's more correct as tests
go.
Differential Revision: https://phab.mercurial-scm.org/D9790
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 14 Jan 2021 06:52:36 +0100] rev 46258
tests: wider work around matching in test-narrow-shallow.t
Since issue6150 is still not fixed, we have to accommodate a larger array of
possible results. Otherwise we get frequent flakiness of local and CI runs.
Differential Revision: https://phab.mercurial-scm.org/D9766
Augie Fackler <augie@google.com> [Wed, 13 Jan 2021 15:44:24 -0500] rev 46257
fuzz: try and ensure fuzzer tests run against the right python-config
Also only under python 3.
Differential Revision: https://phab.mercurial-scm.org/D9752
Raphaël Gomès <rgomes@octobus.net> [Fri, 08 Jan 2021 16:25:18 +0100] rev 46256
contrib: remove testing for `dirstate-tree` Rust feature
This feature will be replaced in a few months, and served more as a
proof-of-concept. Keeping it in CI when no one is using it anymore is just
wasteful.
Differential Revision: https://phab.mercurial-scm.org/D9716
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 17:21:51 +0100] rev 46255
perf: don't turn byte to string when formatting perfbranchmap
I am not sure why this `str` all is there is the first place.
Differential Revision: https://phab.mercurial-scm.org/D9751
Joerg Sonnenberger <joerg@bec.de> [Fri, 18 Dec 2020 14:45:28 +0100] rev 46254
branchmap: avoid ancestor computations in absence of non-continous branches
The branchhead computation is one of the more heavy operations for
bigger repositories as it has to scan all changesets and potentially
involves the expensive computation of the ancestor sets. Redo the
computation to handle the common cases directly and use tighter
conditions for when the ancestor scan is necessary. Most importantly,
avoid it completely if the non-continous branches are processed in one
update as seen in the initial computation after a clone.
For the Mercurial repository, it gives a small 2-3% performance boost.
For the NetBSD test repository, it cuts the time in half.
Differential Revision: https://phab.mercurial-scm.org/D9631
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 19:49:18 +0100] rev 46253
persistent-nodemap: also list related file as part of the store
This make sure they are will be selected during upgrade, and copy based clone.
Differential Revision: https://phab.mercurial-scm.org/D9749
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 13 Jan 2021 12:50:47 +0100] rev 46252
upgrade: explicitly test for revlog index
We do not want to exclude `.d` we want to only include `.i`. We are about to add
more extension type (for the persistent nodemap: `.n`, `.nd`) so lets make the
list explicit instead.
Differential Revision: https://phab.mercurial-scm.org/D9748
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 19:47:34 +0100] rev 46251
persistent-nodemap: highlight that node is not sent when streaming
We have a local work-around, however having that data sent in the first place
would be better. So we start with a test that monitor what is sent, and notice
they are not.
Differential Revision: https://phab.mercurial-scm.org/D9736
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 12 Jan 2021 18:13:55 +0100] rev 46250
persistent-nodemap: test it (does not) exist after a stream clone
This is currently buggy. We add a test before fixing the bug.
Differential Revision: https://phab.mercurial-scm.org/D9734