Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Jan 2020 18:59:49 -0800] rev 44087
sha1dc: use buffer protocol when parsing arguments
Without this, functions won't accept bytearray, memoryview,
or other types that can be exposed as bytes to the C API.
The most resilient way to obtain a bytes-like object from
the C API is using the Py_buffer interface.
This commit converts use of s#/y# to s*/y* and uses
Py_buffer for accessing the underlying bytes array.
I checked how hashlib is implemented in CPython and the
the implementation agrees with its use of the Py_buffer
interface as well as using BufferError in cases of bad
buffer types. Sadly, there's no good way to test for
ndim > 1 without writing our own C-backed Python type.
Differential Revision: https://phab.mercurial-scm.org/D7879
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Jan 2020 20:05:37 -0500] rev 44086
lfs: avoid quadratic performance in processing server responses
This is also adapted from the Facebook repo[1]. Unlike there, we were already
reading the download stream in chunks and immediately writing it to disk, so we
basically avoided the problem on download. There shouldn't be a lot of data to
read on upload, but it's better to get rid of this pattern.
[1] https://github.com/facebookexperimental/eden/commit/
82df66ffe97e21f3ee73dfec093c87500fc1f6a7
Differential Revision: https://phab.mercurial-scm.org/D7882
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Jan 2020 19:42:24 -0500] rev 44085
lfs: check content length after downloading content
Adapted from the Facebook repo[1]. The intent is to distinguish between the
connection dying and getting served a corrupt blob.
The original message:
HTTP makes no provision to tell your client that you failed halfway through
producing your response and won't have the answer they're looking for. So, if a
LFS server fails while producing a response, then we'll report an OID mismatch.
We can do a little better and disambiguate between "the server sent us the
wrong blob" (very scary) and "the server crashed" (merely annoying) by looking
at the content length of the response we got back. If it's not what was
advertised, we can reasonably safely assume the server crashed.
[1] https://github.com/facebookexperimental/eden/commit/
2a4a6fab4e882ed89b948bfc1e7d56d7c3c99dd2
Differential Revision: https://phab.mercurial-scm.org/D7881
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Jan 2020 18:02:20 -0500] rev 44084
lfs: rename a variable to clarify its use
This is the response object, not a request.
Differential Revision: https://phab.mercurial-scm.org/D7880
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Jan 2020 17:53:43 -0800] rev 44083
sha1dc: use proper string functions on Python 2/3
PyString_FromStringAndSize doesn't exist on Python 3: we need
to use PyUnicode_FromStringAndSize.
The extension now compiles without warnings on Python 2 and 3.
Differential Revision: https://phab.mercurial-scm.org/D7878
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Jan 2020 17:39:12 -0800] rev 44082
sha1dc: declare all variables at begininng of block
This is required to appease ancient C language standards, which
msvc 2008 still requires for Python 2.7 on Windows.
Differential Revision: https://phab.mercurial-scm.org/D7877
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Jan 2020 17:37:04 -0800] rev 44081
sha1dc: manually define integer types on msvc 2008
Python 2.7 on Windows builds with MSVC 2008, which
doesn't include stdint.h. So we need to check for the
compiler version and manually define missing types when it
is ancient.
Differential Revision: https://phab.mercurial-scm.org/D7876
Martin von Zweigbergk <martinvonz@google.com> [Tue, 14 Jan 2020 14:18:11 -0800] rev 44080
packaging: leverage os.path.relpath() in setup.py
`os.path.relpath()` has existed since Python 2.6, so we can safely use
it. This fixes a bug in the current code when the common prefix is "/"
(in which case `uplevel` would be one less than it should).
Differential Revision: https://phab.mercurial-scm.org/D7875
Raphaël Gomès <rgomes@octobus.net> [Tue, 14 Jan 2020 18:00:05 +0100] rev 44079
rust-utils: add util to find a slice in another slice
Differential Revision: https://phab.mercurial-scm.org/D7863
Raphaël Gomès <rgomes@octobus.net> [Tue, 14 Jan 2020 16:00:57 +0100] rev 44078
dirstate: move rust fast-path calling code to its own method
This logic is about to get bigger, this will make it easier to read and not
pollute the main Python logic.
Differential Revision: https://phab.mercurial-scm.org/D7862
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Jan 2020 00:52:53 -0500] rev 44077
lfs: add "bytes" as the unit to the upload/download progress bar
Facebook also passes `util.bytecount()` as a pretty formatter here, but our
progress bar doesn't support that.
Differential Revision: https://phab.mercurial-scm.org/D7872
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Jan 2020 16:37:45 -0500] rev 44076
phabricator: post revisions in ascending topological order (
issue6241)
The parent in phabricator ends up being the last revision posted, so sorting the
user input into ascending order should be enough to preserve the proper
relationships.
Differential Revision: https://phab.mercurial-scm.org/D7874
Matt Harbison <matt_harbison@yahoo.com> [Tue, 14 Jan 2020 16:29:03 -0500] rev 44075
doc: fix references to `revset.abstractsmartset`
Differential Revision: https://phab.mercurial-scm.org/D7873
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Jan 2020 20:09:32 -0800] rev 44074
fsmonitor: properly handle str ex.msg
ex.msg is always a str, since pywatchman uses str for exception messages.
This commit removes a b'' from a string compare to avoid types
mismatch and adds a coercion to bytes before stuffing the exception
message on our local exception type, which uses bytes for the message
elsewhere in this file.
Differential Revision: https://phab.mercurial-scm.org/D7855
Matt Harbison <matt_harbison@yahoo.com> [Mon, 23 Dec 2019 01:12:20 -0500] rev 44073
verify: allow the storage to signal when renames can be tested on `skipread`
This applies the new marker in the lfs handler to show it in action, and adds
the test mentioned at the beginning of the series to show that fulltext isn't
necessary in the LFS case.
The existing `skipread` isn't enough, because it is also set if an error occurs
reading the revlog data, or the data is censored. It could probably be cleared,
but then it technically violates the interface contract. That wouldn't matter
for the existing verify algorithm, but it isn't clear how that will change as
alternate storage support is added.
The flag is probably pretty revlog specific, given the comments in verify.py.
But there's already filelog specific stuff in there and I'm not sure what future
storage will bring, so I don't want to over-engineer this. Likewise, I'm not
sure that we want the verify method for each storage type to completely drive
the bus when it comes to detecting renames, so I don't want to go down the
rabbithole of having verifyintegrity() return metadata hints at this point.
Differential Revision: https://phab.mercurial-scm.org/D7713
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Dec 2019 23:50:19 -0500] rev 44072
lfs: don't skip locally available blobs when verifying
The `skipflags` config was introduced in
a2ab9ebcd85b, which specifically calls
out downloading and storing all blobs as potentially too expensive. But I don't
see any reason to skip blobs that are already available locally. Hashing the
blob is the only way to indirectly verify the rawdata content stored in the
revlog.
(The note in that commit about skipping renamed is still correct, but the reason
given about needing fulltext isn't.)
Differential Revision: https://phab.mercurial-scm.org/D7712
Matt Harbison <matt_harbison@yahoo.com> [Fri, 20 Dec 2019 01:11:35 -0500] rev 44071
lfs: add a switch to `hg verify` to ignore the content of blobs
Trying to validate the fulltext of an external revision causes missing blobs to
be downloaded and cached. Since the downloads aren't batch prefetched[1] and
aren't compressed, this can be expensive both in terms of time and space.
I made this a tri-state instead of a simple bool because there's an existing
(undocumented) config to handle this, and it would be weird if `hg verify` were
to suddenly start ignoring that config but an `hg recover` initiated verify
honors it. Since this uses the same config setting, it too will skip
rename verification (which requires fulltext, but not for LFS).
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-April/116118.html
Differential Revision: https://phab.mercurial-scm.org/D7708
Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 14:37:54 -0500] rev 44070
revlog: run rustfmt nightly
I'm a little nervous about folding this back (might be nightly rustfmt
mismatches?) so I want someone to review this.
Differential Revision: https://phab.mercurial-scm.org/D7813
Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 14:37:01 -0500] rev 44069
examples: specify rustfmt nightly using a $() construct
This is ugly, but it's how we have to configure rustfmt for now as we
require nightly rustfmt.
Differential Revision: https://phab.mercurial-scm.org/D7812
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 07 Dec 2019 13:13:48 -0800] rev 44068
hg-core: rustfmt path.rs
The file as vendored does not conform to our source formatting
conventions. Let's reformat it so it does.
# skip-blame automated code reformatting
Differential Revision: https://phab.mercurial-scm.org/D7580
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 07 Dec 2019 10:26:28 -0800] rev 44067
hg-core: vendor Facebook's path utils module
The added file was imported from
https://github.com/facebookexperimental/eden/blob/
d1d8fb939a39aa331ae7f162c39cbcaa511d474b/eden/scm/lib/util/src/path.rs
without modifications. The file is not yet integrated into our project. This
will be done in subsequent commits.
Differential Revision: https://phab.mercurial-scm.org/D7573
Georges Racinet <georges.racinet@octobus.net> [Tue, 14 Jan 2020 12:04:12 +0100] rev 44066
revlog-native: introduced ABI version in capsule
Concerns that an inconsistency could arise between the actual contents
of the capsule in revlog.c and the Rust consumer have been raised after
the switch to the array of data and function pointers in
f384d68d8ea8.
It has been suggested that the `version` from parsers.c could be use for
this. In this change, we introduce instead a separate ABI version number,
which should have the following advantages:
- no need to change the consuming Rust code for changes that have nothing
to do with the contents of the capsule
- the version number in parsers.c is not explicitely flagged as ABI. It's
not obvious to me whether an ABI change that would be invisible to Python
would warrant an increment
The drawback is that developers now have to consider two version numbers.
We expect the added cost of the check to be negligible because it occurs
at instantiation of `CIndex` only, which in turn is tied to instantiation
of Python objects such as `LazyAncestors` and `MixedIndex`. Frequent calls
to `Cindex::new` should also probably hit the CPU branch predictor.
Differential Revision: https://phab.mercurial-scm.org/D7856
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 13 Jan 2020 19:11:44 -0800] rev 44065
phases: make phasecache._phasesets immutable
Previously, some code paths would mutate the cache itself, which
could give weird results if multiple revsets got evaluated through
that path.
Differential Revision: https://phab.mercurial-scm.org/D7854
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 13 Jan 2020 19:06:36 -0800] rev 44064
phases: reduce code duplication in phasecache.getrevset
This is a functional NOP other than reducing some of the duplication
in that method.
Differential Revision: https://phab.mercurial-scm.org/D7853
Matt Harbison <matt_harbison@yahoo.com> [Mon, 13 Jan 2020 17:18:03 -0500] rev 44063
scmutil: fix an unbound variable with progressbar debug enabled
Differential Revision: https://phab.mercurial-scm.org/D7852
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 14:12:31 -0500] rev 44062
hgext: replace references to hashlib.sha1 with hashutil.sha1
When in a non-pure build of Mercurial, this will provide protections
against SHA1 collision attacks.
Differential Revision: https://phab.mercurial-scm.org/D7851
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 17:16:54 -0500] rev 44061
sslutil: migrate to hashutil.sha1 instead of hashlib.sha1
This is a straight-line replacement like the others, but I split it
out since it's used in a network context and I'm not sure this is
appropriate (we should probably drop support for sha1
fingerprints over TLS) and wanted this to be easily dropped.
Differential Revision: https://phab.mercurial-scm.org/D7850
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 17:15:14 -0500] rev 44060
core: migrate uses of hashlib.sha1 to hashutil.sha1
Differential Revision: https://phab.mercurial-scm.org/D7849
Augie Fackler <augie@google.com> [Mon, 13 Jan 2020 17:14:19 -0500] rev 44059
hashutil: new package for hashing-related features
Right now this just tries to use our sha1dc and if it's missing (eg a
--pure build) we fall back to hashlib. I imagine in the future we'll
want some other things in here for detecting what hasher is in use as
we transition off sha1.
Differential Revision: https://phab.mercurial-scm.org/D7848
Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 15:59:52 -0500] rev 44058
sha1dc: initial implementation of Python extension
A future change will use this when available to avoid sha1 collision
issues until we can get moved to something else.
Differential Revision: https://phab.mercurial-scm.org/D7815
Augie Fackler <augie@google.com> [Wed, 08 Jan 2020 15:09:01 -0500] rev 44057
sha1dc: import latest version from github
After the recent SHA1 news, the attacks are serious enough we should
be more proactive. This code will at least allow detection of attacks
early. It's already widely deployed in Git.
This is git revision
855827c583bc30645ba427885caa40c5b81764d2 of the
sha1collisiondetection repo[0], with most of the files omitted. A
follow-up change will introduce Python bindings for this code.
0: https://github.com/cr-marcstevens/sha1collisiondetection
Differential Revision: https://phab.mercurial-scm.org/D7814
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 11 Jan 2020 05:44:58 +0100] rev 44056
transaction: add a `hasfinalize` method
The method allow code to check if an existing callback exists. It allow them to
skip potentially expensive setup for a callback.
Differential Revision: https://phab.mercurial-scm.org/D7832
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 11 Jan 2020 04:57:29 +0100] rev 44055
changelog: fix the diverted opener to accept more kwargs
The current code prevent the use of `atomictemp` file with the changelog
opener. I do not see a good reason for this limitation.
Differential Revision: https://phab.mercurial-scm.org/D7831
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 06 Jan 2020 08:08:06 +0100] rev 44054
revlog: reorder a conditionnal about revlogio
if we are using REVLOGV0, we will not use a rust based index. This small line
movement make it clearer.
Differential Revision: https://phab.mercurial-scm.org/D7830
Martin von Zweigbergk <martinvonz@google.com> [Fri, 10 Jan 2020 15:47:39 -0800] rev 44053
rebase: delete seemingly unnecessary needupdate()
This seemed to be about checking that the user hasn't updated away
when we asked them to resolve merge conflicts. These days we call
`cmdutil.checkunfinished()` and refuse to update, so the user
shouldn't be able to get into this state.
`test-rebase-interruptions.t` actually has some tests where it
disables the rebase extension in order to be allowed to do some of
these updates. That still passes, but I wouldn't personally haved
cared if that failed.
Differential Revision: https://phab.mercurial-scm.org/D7825
Martin von Zweigbergk <martinvonz@google.com> [Fri, 10 Jan 2020 13:24:25 -0800] rev 44052
workingctx: move setparents() logic from localrepo to mirror overlayworkingctx
It would be nice to later be able to call `wctx.setparents()` whether
`wctx` is a `workingctx` or an `overlayworkingctx`.
Differential Revision: https://phab.mercurial-scm.org/D7823
Martin von Zweigbergk <martinvonz@google.com> [Fri, 10 Jan 2020 21:41:28 -0800] rev 44051
overlayworkginctx: implement a setparents() to mirror dirstate.setparents()
This lets us make the in-memory and on-disk code a bit more
similar. I'll soon also implement setparents() on the regular
workingctx.
Differential Revision: https://phab.mercurial-scm.org/D7822
Martin von Zweigbergk <martinvonz@google.com> [Fri, 10 Jan 2020 17:03:23 -0800] rev 44050
overlayworkingctx: default branch to base context's branch
This matches what the dirstate does (it reuses working copy parent's
branch unless told otherwise). By moving the default out of
`rebase.commitmemorynode()`, it will let us clean that up better
later.
Differential Revision: https://phab.mercurial-scm.org/D7821
Martin von Zweigbergk <martinvonz@google.com> [Thu, 09 Jan 2020 15:41:40 -0800] rev 44049
grep: speed up `hg grep --all-files some/path` by using ctx.matches(match)
ctx.matches(match) avoids walking unintersting parts of the tree when
using tree manifests. That can make a very big difference when
grepping in a small subset of the tree (2.0s -> 0.7s in my case, but
can of course be made more extreme by picking a smaller subset of
files).
Differential Revision: https://phab.mercurial-scm.org/D7820
timeless <timeless@mozdev.org> [Thu, 09 Jan 2020 14:19:20 -0500] rev 44048
fix: fix grammar/typos in hg help -e fix
Matt Harbison <matt_harbison@yahoo.com> [Thu, 09 Jan 2020 10:17:10 -0500] rev 44047
py3: byteify the opener option to use `rust.index` to allow Rust revlogs
It looks like this corresponds to the byteified key written in localrepo in
8042856c90b6.
Differential Revision: https://phab.mercurial-scm.org/D7818
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 21:11:36 -0800] rev 44046
graft: use revset for intersecting with ancestor set
This addresses a TODO added in
a1381eea7c7d (graft: do not use
`.remove` on a smart set (regression), 2014-04-28).
Differential Revision: https://phab.mercurial-scm.org/D7806
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 21:11:33 -0800] rev 44045
graft: don't remove from a list in a loop
This addresses a TODO added in
a1381eea7c7d (graft: do not use
`.remove` on a smart set (regression), 2014-04-28). I couldn't measure
any speedup.
Differential Revision: https://phab.mercurial-scm.org/D7805
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 22:40:52 -0800] rev 44044
tests: avoid grafting the same change over and over
The test case added in
a1381eea7c7d (graft: do not use `.remove` on a
smart set (regression), 2014-04-28) added a test case that grafted the
same change (renaming 'a' to 'b') three times over. It had description
"graft works on complex revset", but AFACT, all that it cared about
was that some ancestor of the working copy was in the set of revisions
to graft. So this patch changes the test to do that instead.
(I plan to later make it so that grafting these renames on top of each
won't create the empty commits they currently create.)
Differential Revision: https://phab.mercurial-scm.org/D7804
Matt Harbison <matt_harbison@yahoo.com> [Wed, 08 Jan 2020 20:23:24 -0500] rev 44043
py3: byteify some `ui.configbool()` parameters
This popped up in
8042856c90b6.
Differential Revision: https://phab.mercurial-scm.org/D7817
Georges Racinet <georges.racinet@octobus.net> [Mon, 23 Dec 2019 17:47:31 +0100] rev 44042
rust-discovery: type alias for random generator seed
It just makes our life easier
Differential Revision: https://phab.mercurial-scm.org/D7715
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 15:53:16 -0800] rev 44041
tests: split out another ~1/2 of test-graft.t
The tests involving renames were also quite independent from the rest.
Differential Revision: https://phab.mercurial-scm.org/D7803
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 15:39:48 -0800] rev 44040
tests: split out ~1/3 of test-graft.t
test-graft.t is ~2400 lines and takes 34s to run. This patch moves the
last ~1/3 of it to a separate file. The parts now run in 22s + 13s. On
top of that, we can remove the #testcases from the old file, so it's
only 22s + 2*13s instead of the 2*34s it was before.
Differential Revision: https://phab.mercurial-scm.org/D7802
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 14:08:02 -0800] rev 44039
overlwayworkingctx: remove doubly bad reference to wrapped ctx for copies
`_wrappedctx` lives on overlwayworkingctx, not on the repo object, so
we should access it as `._wrappedctx`, not `._repo._wrappedctx`. More
importantly, the overlayworkingctx is relative to its base, not
including it, so the copies returned should not include copies made in
the base.
Differential Revision: https://phab.mercurial-scm.org/D7801
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 12:41:56 -0800] rev 44038
movedirstate: get copies from dirstate before setting parents
Setting dirstate parents can modify the copies recorded in the
dirstate when there are two dirstate parents. I don't think we ever
call movedirstate() when there is more than one parent, but it seems
clearer to get the copies from the dirstate first anyway.
Differential Revision: https://phab.mercurial-scm.org/D7800
Kyle Lippincott <spectral@google.com> [Thu, 12 Dec 2019 14:31:11 -0800] rev 44037
fix: convert clang-format-ignorelist to use wildcards
It's very brittle to specify the exact filenames for these vendored/thirdparty
libraries; when there's an upgrade, it's likely not going to be updated.
Differential Revision: https://phab.mercurial-scm.org/D7619
Connor Sheehan <sheehan@mozilla.com> [Wed, 08 Jan 2020 11:59:32 -0500] rev 44036
packaging: update Ubuntu docker build dependencies to Python 3
Changeset
7574ccd87200f02e updated the Debian docker builds to Python 3. In doing
so, the Ubuntu docker-based builds broke, as the Dockerfile does not
include the new dependencies as specified in `contrib/packaging/debian/control`.
This commit changes the dependencies in the Ubuntu Dockerfile template
to their Python 3 equivalents, fixing `make docker-ubuntu-bionic`.
Differential Revision: https://phab.mercurial-scm.org/D7810
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Jan 2020 12:09:36 +0100] rev 44035
mmap: add a size argument to mmapread
With this argument, we can control the size of the mmap created. (previously it
was always the whole file.
Differential Revision: https://phab.mercurial-scm.org/D7808
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 07 Jan 2020 12:26:37 +0100] rev 44034
revlogutils: move the NodeMap class in a dedicated nodemap module
We will introduce more nodemap related code, so it make sense to move the
existing code in that module first.
Differential Revision: https://phab.mercurial-scm.org/D7809
Kyle Lippincott <spectral@google.com> [Thu, 02 Jan 2020 17:27:37 -0800] rev 44033
progress: flush stderr after clearing
On python3, ui.stderr is buffered, it seems, so we need to flush it to actually
get the progress bar off the screen. This is important since ui.write() will
call into progbar.clear() if it thinks there's a progress bar on the screen,
with the intent that the next thing it outputs is at the beginning of the line
(instead of at the end of the progress bar line). Without the flush, we buffer
up the clearing of the screen, and we get some really weird/corrupt output.
Differential Revision: https://phab.mercurial-scm.org/D7784
Matt Harbison <matt_harbison@yahoo.com> [Sun, 29 Dec 2019 21:10:04 -0500] rev 44032
rcutil: drop the `defaultrcpath()` method (API)
The resource based code can service py2, py3 and an oxidized executable, so
there's no reason to leave this around. It was flagged as an API change when it
was introduced, so flagging it again.
Differential Revision: https://phab.mercurial-scm.org/D7777
Matt Harbison <matt_harbison@yahoo.com> [Sun, 29 Dec 2019 21:06:34 -0500] rev 44031
ui: add the ability to apply `defaultrc` configs from resources
We will want the ability to cat out these resources, but the same would apply to
templates, so I'm going to wait for the dust to settle on that. Reading the
default config directly from the filesystem is still in place for now.
Differential Revision: https://phab.mercurial-scm.org/D7776
Matt Harbison <matt_harbison@yahoo.com> [Sun, 29 Dec 2019 20:51:44 -0500] rev 44030
ui: refactor `readconfig()` into a form that can consume resources
The old form can't completely go away, because files outside of packages still
need to be read. The name passed in here is a tuple of `package name, resource`
as needed by the resource API.
I like the idea of stating the config file is embedded in the executable by
listing is as `exe!package.resource`. This would be consistent with how
`debuginstall` points to the executable for the python executable, lib, and
installed modules. While in practice the filesystem path is available from the
backing ResourceReader when the resource is opened, it is a relative path on py2
and absolute on py3. Further, while this would show in the `hg config` output
for each option if set as such here, it doesn't show in the `reading from...`
line when `--debug` is used. The file isn't actually open where that prints, so
there's no way I see to get that info there. So I opted for the simple prefix
to distinguish resources from files.
Differential Revision: https://phab.mercurial-scm.org/D7775
Matt Harbison <matt_harbison@yahoo.com> [Sun, 29 Dec 2019 20:35:34 -0500] rev 44029
resourceutil: implement `contents()` to iterate over resources in a package
Differential Revision: https://phab.mercurial-scm.org/D7774
Matt Harbison <matt_harbison@yahoo.com> [Sun, 29 Dec 2019 20:32:56 -0500] rev 44028
resourceutil: implement `is_resource()`
This will be needed when iterating resources.
Differential Revision: https://phab.mercurial-scm.org/D7773
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Dec 2019 23:35:13 -0500] rev 44027
resourceutil: don't limit resources to the `mercurial` package
This should make things a little clearer, in that it now requires the full
package name to access a resource. But the real motivation is that
`extensions._disabledpaths()` walks the `hgext` directory looking for bundled
extensions. This in turn feeds, among other things:
1) Listing disabled extensions in `hg help extensions`
2) Indicating that an unknown command is in a non-enabled extension
3) Displaying help for non-enabled extensions
4) Generating documentation
5) Announcing LFS is auto-enabled (or not) when cloning from an LFS source
The filesystem based ResourceReader will happily return *.py and *.pyc, but the
one supplied by PyOxidizer doesn't. Presumably we can change that. The only
other idea I had here is for setup.py to generate a text file containing the
list of extensions, but that doesn't seem great when running from source.
Differential Revision: https://phab.mercurial-scm.org/D7772
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Dec 2019 23:08:57 -0500] rev 44026
setup: include `defaultrc` in the package list
This is needed to access the config files via the resourceutil framework, which
is needed to embed the config files when uing PyOxidizer.
Differential Revision: https://phab.mercurial-scm.org/D7771
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 24 Dec 2019 20:17:40 +0300] rev 44025
tests: update test-releasenotes-formatting.t output
The output seems to be left outdated because running this test requires
fuzzy-wuzzy which is not generally installed.
Differential Revision: https://phab.mercurial-scm.org/D7723
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Dec 2019 02:11:51 -0500] rev 44024
tests: fix a copy/paste name duplication in storage.py
Flagged by PyCharm as a redeclared name without usage, because the name matches
the function immediately preceding it. But since this differs by doing regular
reads instead of raw reads, I assume we still want it. But I don't see either
function being called anywhere.
Differential Revision: https://phab.mercurial-scm.org/D7769
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Dec 2019 02:02:34 -0500] rev 44023
commit: change default `editor` parameter to None
Flagged by PyCharm as a boolean not being callable later where it is used.
There's no actual bug here because of `if editor` checks before using.
Differential Revision: https://phab.mercurial-scm.org/D7768
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Dec 2019 01:51:17 -0500] rev 44022
cleanup: drop redundant character escapes outside of `[]`
Flagged by PyCharm. `@`, `:`, `<`, `>`, and `{` aren't special characters.
(I'm a bit surprised that it doesn't also want to unescape `}` in schemes.py.)
Differential Revision: https://phab.mercurial-scm.org/D7767
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Dec 2019 01:35:05 -0500] rev 44021
cleanup: drop redundant character escapes from `[]` character sets
Flagged by PyCharm. Most special characters lose their special meaning inside
square brackets. The `-` in util.py doesn't need to be escaped because it is
the last character in the set.
Differential Revision: https://phab.mercurial-scm.org/D7766
Matt Harbison <matt_harbison@yahoo.com> [Sat, 28 Dec 2019 01:12:19 -0500] rev 44020
cleanup: replace contiguous spaces in regex patterns with an explicit count
Flagged by PyCharm, this form should be more readable.
Differential Revision: https://phab.mercurial-scm.org/D7765
Matt Harbison <matt_harbison@yahoo.com> [Mon, 30 Dec 2019 12:17:02 -0500] rev 44019
mq: avoid using `__file__` to compare modules
This fixes ~70 tests when using an oxidized executable, bringing the current
failure count down to 92 (with 110 skips) when templates/ is copied next to the
executable.
Differential Revision: https://phab.mercurial-scm.org/D7778
Matt Harbison <matt_harbison@yahoo.com> [Tue, 31 Dec 2019 16:24:38 -0500] rev 44018
util: avoid referencing `time.clock()` on Windows when missing (
issue6238)
It's been removed in 3.8, and issues a deprecation warning since 3.3.
Differential Revision: https://phab.mercurial-scm.org/D7780
Matt Harbison <matt_harbison@yahoo.com> [Mon, 30 Dec 2019 23:53:53 -0500] rev 44017
py3: replace `time.clock()` with `time.perf_counter()`
The former was removed in 3.8. The util function uses `time.clock()` if the
latter is unavailable.
Differential Revision: https://phab.mercurial-scm.org/D7779
Kyle Lippincott <spectral@google.com> [Wed, 08 Jan 2020 09:59:34 -0800] rev 44016
tests: fix a "naked exception" issue in test-remotefilelog-prefetch.t
Differential Revision: https://phab.mercurial-scm.org/D7811
Matt Harbison <matt_harbison@yahoo.com> [Tue, 24 Dec 2019 01:38:02 -0500] rev 44015
subrepo: fix a crash when archiving an svn or git subrepo
Only hgsubrepos have a repository attribute. This is pretty hacky, but probably
the best we can do on stable. Pushing the lfstatus check down into the wrapper
for hgsubrepo (and dropping the check for lfstatus at the top of
`hgsubrepoarchive()`) resulted in various test failures because:
1) hgsubrepoarchive isn't returning the number of files archived at the
bottom, resulting in an error about += NoneType
2) These copypasta archive wrappers don't use progress bars
3) Largefiles are *not* currently archived when using extdiff (
68822b7cdd01),
but pushing this context manager down into the subrepo resulted in it
apparently doing so (as evidenced by progress bars being dropped)
The other uses of `lfstatus()` are not in the substate processing loop, so they
shouldn't be an issue.
I initially put testcases in this test for largefiles-{on,off}, and it flagged
a bunch of exit code differences for `cat` and `diff`, so I backed that off.
Differential Revision: https://phab.mercurial-scm.org/D7714
Georges Racinet <georges.racinet@octobus.net> [Thu, 12 Dec 2019 18:31:17 +0100] rev 44014
rust-index: add a `experimental.rust.index` option to use the wrapper
Now we can start putting this wrapper on the test and benchmark grill.
Differential Revision: https://phab.mercurial-scm.org/D7660
Georges Racinet <georges.racinet@octobus.net> [Wed, 11 Dec 2019 18:10:20 +0100] rev 44013
rust-index: use the new method in shortesthexnodeidprefix
This code can now run with both a Rust or a C index.
Differential Revision: https://phab.mercurial-scm.org/D7659
Georges Racinet <georges.racinet@octobus.net> [Thu, 12 Dec 2019 03:39:14 +0100] rev 44012
rust-index: expose a method to retrieve the C index
The code for `shortesthexnodeidprefix` need to access the actual C index. For
now we grant its wish and expose a method to do so. Once we have the nodemap in
Rust, we will be able to implement the same feature from rust and we will be
able to drop this method.
Differential Revision: https://phab.mercurial-scm.org/D7658
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 12 Dec 2019 18:11:44 +0100] rev 44011
rust-index: handle `MixedIndex` in `pyindex_to_graph`
On the long run we will want to implement the Graph trait directly in Rust, but
for now we take the path with the least amount of change to focus on the coming
persistent NodeMap code.
We test this new code through with the lazy ancestors code.
Differential Revision: https://phab.mercurial-scm.org/D7657
Georges Racinet <georges.racinet@octobus.net> [Fri, 13 Dec 2019 19:52:26 +0100] rev 44010
rust-index: make it possible to clone the struct referencing the C index
If we are to hand over the C index object to other code, we need to be able to
create a new python reference to it.
Differential Revision: https://phab.mercurial-scm.org/D7656
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Dec 2019 20:40:02 -0500] rev 44009
match: resolve filesets against the passed `cwd`, not the current one
This allows filesets to be resolved relative to `repo.root`, the same as other
patterns are since
f02d3c0eed18. The current example in contrib/ wasn't working
from the tests directory because of this.
Differential Revision: https://phab.mercurial-scm.org/D7570
Kyle Lippincott <spectral@google.com> [Thu, 12 Dec 2019 14:28:31 -0800] rev 44008
fix: correct the clang-format example hgrc so that it actually works
There are three changes here:
* Remove -i from `command`, it causes fix to eat your file and empty it out
* Add `set:` to pattern, otherwise this is interpreted as just a glob
* Switch `listfile:` to `include:`; `listfile:` is relative to the current
working directory, while `include:` is relative to the repo root. This makes
it so that you don't receive errors when running outside of the repo root
about being unable to find the file.
Differential Revision: https://phab.mercurial-scm.org/D7618
Matt Harbison <matt_harbison@yahoo.com> [Wed, 18 Dec 2019 00:41:12 -0500] rev 44007
inno: drop support for Windows 95/98/ME
Differential Revision: https://phab.mercurial-scm.org/D7696
Georges Racinet <georges.racinet@octobus.net> [Wed, 25 Dec 2019 19:03:07 +0100] rev 44006
rust-matchers: fixing cargo doc
Block quotes marked as `ignore` are still parsed as Rust
source examples.
Differential Revision: https://phab.mercurial-scm.org/D7783
Georges Racinet <georges.racinet@octobus.net> [Wed, 25 Dec 2019 15:17:55 +0100] rev 44005
rust-core: extracted a revlog submodule
This moves fundamental definitions from the top of the crate
to the newly created `revlog` submodule and reexports them for
easy compatibility.
As we are about to add new features to this crate, we felt it
will improve clarity, and moreso if `ancestors` and `dagops`
would become submodules of `revlog`.
Differential Revision: https://phab.mercurial-scm.org/D7782
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Thu, 19 Dec 2019 00:32:42 -0800] rev 44004
phases: make the working directory consistently a draft
Before this change, `hg log -r 'wdir() and public()'` would return it.
Differential Revision: https://phab.mercurial-scm.org/D7705
Georges Racinet <georges.racinet@octobus.net> [Wed, 25 Dec 2019 14:53:45 +0100] rev 44003
rust-core: updated copyright notice
The intention here is to put an email address that actually
works (I did have full personal copyrights with my
former affiliation).
It is also an opportunity to acknowledge that I've not been
the only one to work on this file.
Differential Revision: https://phab.mercurial-scm.org/D7781
Martin von Zweigbergk <martinvonz@google.com> [Fri, 27 Dec 2019 09:55:35 -0800] rev 44002
tests: fix failing doctest in match.py by adding dummy auditor
It was failing with "OSError: [Errno 13] Permission denied:
'/root/sub'". It has been failing since
8b1a9ba375e5 (match: make sure
`root` argument is always an absolute path (API), 2019-12-13). I don't
know why I didn't notice it before sending that patch.
Differential Revision: https://phab.mercurial-scm.org/D7731
Kyle Lippincott <spectral@google.com> [Thu, 02 Jan 2020 17:30:27 -0800] rev 44001
remotefilelog: actually fix (and test this time) a bytes vs str issue
I attempted this in
94670e124d29 but we didn't actually have any tests for this
function it seems, and I mistook "it works now" for it being fixed (when what
had actually happened was that my cache had populated enough that I didn't
trigger the minimum threshold on my reattempts).
Differential Revision: https://phab.mercurial-scm.org/D7785
Augie Fackler <augie@google.com> [Tue, 07 Jan 2020 09:26:06 -0500] rev 44000
merge with stable
Augie Fackler <raf@durin42.com> [Mon, 06 Jan 2020 14:58:32 -0500] rev 43999
Added signature for changeset
b4c82b704180
Augie Fackler <raf@durin42.com> [Mon, 06 Jan 2020 14:58:31 -0500] rev 43998
Added tag 5.2.2 for changeset
b4c82b704180
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 19:00:38 -0500] rev 43997
revset: drop some unused code in the `remote` revset
PyCharm flagged the `revs = [..]` as an unused assignment. But then neither
`revs` nor `checkout` is used, and I can't see where `hg.addbranchrevs()` has
external side effects.
Differential Revision: https://phab.mercurial-scm.org/D7764
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:52:48 -0500] rev 43996
tests: avoid using a list comprehension to fill a list with fixed values
Flagged by PyCharm as an unused assignment for the variable in the list.
Differential Revision: https://phab.mercurial-scm.org/D7763
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:21:41 -0500] rev 43995
histedit: avoid using a list comprehension to fill a list with fixed values
Flagged by PyCharm as an unused assignment for the variable in the list.
Differential Revision: https://phab.mercurial-scm.org/D7762
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 28 Dec 2019 09:55:45 -0800] rev 43994
zstandard: vendor python-zstandard 0.13.0
Version 0.13.0 of the package was just released. It contains
an upgraded zstd C library which can result in some performance
wins, official support for Python 3.8, and a blackened code base.
There were no meaningful code or functionality changes in this
release of python-zstandard: just reformatting and an upgraded
zstd library version. So the diff seems much larger than what it
is.
Files were added without modifications.
The clang-format-ignorelist file was updated to reflect a new
header file in the zstd distribution.
# no-check-commit because 3rd party code has different style guidelines
Differential Revision: https://phab.mercurial-scm.org/D7770
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:54:57 -0500] rev 43993
hgweb: delete a local variable instead of setting to `None`
The previous code was flagged by PyCharm as an unused variable assignment.
Differential Revision: https://phab.mercurial-scm.org/D7761
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:52:15 -0500] rev 43992
tests: drop unused local variable assignments in linelog
Flagged by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7760
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:51:45 -0500] rev 43991
ui: delete local variables instead of setting to `None`
The previous code was flagged by PyCharm as an unused variable assignment.
Differential Revision: https://phab.mercurial-scm.org/D7759
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:50:40 -0500] rev 43990
tests: drop unused local variable assignments in remotefilelog
Flagged by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7758
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:43:18 -0500] rev 43989
fastannotate: drop unused local variable assignments
Flagged by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7757
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:34:12 -0500] rev 43988
fsmonitor: drop an unused local variable assignment
Flagged by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7756
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:26:51 -0500] rev 43987
mq: drop an unused variable assignment
Flagged by PyCharm. This variable is the index of a `for` loop below.
Differential Revision: https://phab.mercurial-scm.org/D7755
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 18:19:40 -0500] rev 43986
hgweb: delete local variable instead of setting it to `None`
The previous code was flagged by PyCharm as an unused variable assignment.
Differential Revision: https://phab.mercurial-scm.org/D7754
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 17:58:17 -0500] rev 43985
annotate: avoid using a list comprehension to fill a list with fixed values
Flagged by PyCharm as an unused assignment for the variable in the list.
Differential Revision: https://phab.mercurial-scm.org/D7753
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 17:54:45 -0500] rev 43984
fsmonitor: drop an unused local variable
Flagged by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7752
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 17:53:56 -0500] rev 43983
absorb: avoid using a list comprehension to fill a list with fixed values
Flagged by PyCharm as an unused assignment for the variable in the list.
Differential Revision: https://phab.mercurial-scm.org/D7751
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 16:57:28 -0500] rev 43982
run-tests: ensure the script exits when it fails to change directories
Caught by PyCharm as an unused variable assignment. This regressed in
c496e8c14b9e.
Differential Revision: https://phab.mercurial-scm.org/D7750
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 16:30:14 -0500] rev 43981
shelve: drop an unused variable assignment
Caught by PyCharm. This stopped being used in
a3b285882724.
Differential Revision: https://phab.mercurial-scm.org/D7749
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 14:58:02 -0500] rev 43980
hgweb: drop an unused variable assignment
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7748
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:56:08 -0500] rev 43979
revlog: drop an unused variable assignment
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7747
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:52:39 -0500] rev 43978
rebase: drop an unused variable assignment
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7746
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:50:53 -0500] rev 43977
polib: drop an unused local function
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7745
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:47:17 -0500] rev 43976
perf: drop an unused variable assignment
Caught by PyCharm. A different formatter is created below in `_displaystats()`.
Differential Revision: https://phab.mercurial-scm.org/D7744
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:45:05 -0500] rev 43975
perf: drop an unnecessary `pass`
Differential Revision: https://phab.mercurial-scm.org/D7743
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:42:52 -0500] rev 43974
perf: fix the time measurement for pathcopies relative to p2
PyCharm flagged this as unused. But it seems more likely that it was intended
to reset the time for the p2 path.
Differential Revision: https://phab.mercurial-scm.org/D7742
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:29:45 -0500] rev 43973
githelp: drop unused variable assignments
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7741
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:24:20 -0500] rev 43972
debug: drop unused variable assignments
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7740
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:18:19 -0500] rev 43971
changegroup: drop an unused variable assignment
Caught by PyCharm. The variable is assigned again below before it is used.
Differential Revision: https://phab.mercurial-scm.org/D7739
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:13:33 -0500] rev 43970
bugzilla: drop an unused variable assignment
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7738
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:11:22 -0500] rev 43969
ancestor: drop another unused variable assignment
Also caught by PyCharm. The only time this is used is immediately after another
assignment below this.
Differential Revision: https://phab.mercurial-scm.org/D7737
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 13:05:22 -0500] rev 43968
ancestor: drop an unused local variable assignment
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7736
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 02:44:00 -0500] rev 43967
cleanup: drop unused import from pywatchman
Caught by PyCharm.
Differential Revision: https://phab.mercurial-scm.org/D7735
Matt Harbison <matt_harbison@yahoo.com> [Fri, 27 Dec 2019 02:05:01 -0500] rev 43966
narrow: move `testedwith` after module imports
PyCharm flagged this as a PEP 8 violation, for module level imports not being at
the top of the file.
Differential Revision: https://phab.mercurial-scm.org/D7734
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Dec 2019 18:26:06 -0500] rev 43965
match: don't util.normpath() cwd
The problem here is that `util.normpath()` calls `util.pconvert()`, which
switches to Unix style separators. That results in two test failures like this
since
5685ce2ea3bf:
--- c:/Users/Matt/hg/tests/test-globalopts.t
+++ c:/Users/Matt/hg/tests/test-globalopts.t.err
@@ -89,7 +89,7 @@
[255]
$ hg -R b ann a/a
abort: a/a not under root '$TESTTMP/b'
- (consider using '--cwd b')
+ (consider using '--cwd ..\$TESTTMP\b')
[255]
$ hg log
abort: no repository found in '$TESTTMP' (.hg not found)!
ERROR: test-globalopts.t output changed
Martin originally had `os.path.normpath()` (which *would* work here too), but
changed it during review. He didn't remember why he thought any form is needed
here. Most uses simply pass '' or `repo.getcwd()`, so these should generally be
in local format anyway. It seems better if `cwd` and `root` use consistent
styles here.
Differential Revision: https://phab.mercurial-scm.org/D7725
Matt Harbison <matt_harbison@yahoo.com> [Thu, 26 Dec 2019 16:45:56 -0500] rev 43964
tests: convert the `root` arg of matchmod.match() to local path separators
This fixes tests that broke with
8b1a9ba375e5, complaining that "X not under
root /repo". The vast majority of real uses are to pass `repo.root`, which is
normalized by `wdirvfs.base` being set to the result of `os.path.realpath()`.
Failure to convert looks like this:
--- c:/Users/Matt/hg/tests/test-match.py.out
+++ c:/Users/Matt/hg/tests/test-match.py.err
@@ -0,0 +1,48 @@
+ERROR: testVisitchildrensetGlob (__main__.IncludeMatcherTests)
+
+Traceback (most recent call last):
+ File "c:\Users\Matt\hg\tests\test-match.py", line 180, in testVisitchildrensetGlob
+ m = matchmod.match(b'/repo', b'', include=[b'glob:dir/z*'])
+ File "c:\Users\Matt\hg\mercurial\match.py", line 271, in match
+ kindpats = normalize(include, b'glob', root, cwd, auditor, warn)
+ File "c:\Users\Matt\hg\mercurial\match.py", line 322, in _donormalize
+ pat = pathutil.canonpath(root, cwd, pat, auditor=auditor)
+ File "c:\Users\Matt\hg\mercurial\pathutil.py", line 251, in canonpath
+ _(b"%s not under root '%s'") % (myname, root), hint=hint
+Abort: dir/z* not under root '/repo'
+ERROR: testVisitdirGlob (__main__.IncludeMatcherTests)
Differential Revision: https://phab.mercurial-scm.org/D7724
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 27 Dec 2019 16:47:47 +0100] rev 43963
commitablectx: fix the default phase
The code was ignoring the config option. Since the config option will control
the actual phase of the committed result, we better take it in account early.
Differential Revision: https://phab.mercurial-scm.org/D7726
Kyle Lippincott <spectral@google.com> [Wed, 18 Dec 2019 14:07:58 -0800] rev 43962
fix: fix handling of merge commits by using overlayworkingctx
Most of this code was conceptually copied from what rebase does, with one small
difference: hgext.rebaserev.rebase uses branchmerge=True, while I had to use
branchmerge=False, or else it got really confused about updating to the same
revision in some situations. I believe that the difference is that rebase is
always dealing with *some* form of update - it never gets to mergemod.update if
the source and destination are the same, while we can encounter that situation
with fix. This may imply that this code has some issues with named branches that
should be investigated.
Differential Revision: https://phab.mercurial-scm.org/D7703
Georges Racinet <georges.racinet@octobus.net> [Mon, 23 Dec 2019 10:02:50 -0800] rev 43961
rust-index: add a struct wrapping the C index
Implementing the full index logic in one go is journey larger than we would
like.
To achieve a smoother transition, we start with a simple Rust wrapper that delegates
allwork to the current C implementation. Once we will have a fully working index
object in Rust, we can easily start using more and more Rust Code with it.
The object in this patch is functional and tested. However, multiple of the
currently existing rust (in the `hg-cpython` crate) requires a `Graph`. Right
now we build this `Graph` (as cindex::Index) using the C index passed as
a PyObject. They will have to be updated to be made compatible.
Differential Revision: https://phab.mercurial-scm.org/D7655
Georges Racinet <georges.racinet@octobus.net> [Thu, 12 Dec 2019 03:46:47 +0100] rev 43960
rust-index: add a `inner` method to the Index struct
We are about to introduce a Rust wrapper to the C index. It will be exposed as a
Python object. As a start all call will be forwarded to an internal index object
(as used now).
For this forwarding to works, we need to access that index object (from the C
extensions). We adds a method doing to on the existing `Index` rust struct.
Differential Revision: https://phab.mercurial-scm.org/D7654
Georges Racinet <georges.racinet@octobus.net> [Wed, 27 Nov 2019 17:59:58 +0100] rev 43959
revlog: made C Capsule an array of function pointers
Although it's perfectly valid to put a function pointer in
a capsule, as we've been doing since the start of rust/hg-cpython,
an array of function pointers has several advantages:
- it can hold several functions. That's our main motivation here.
We plan to expose index_length() and index_node(), which will
be needed for a Rust implementation of nodemap.
- it could also have data
- (probably minor in the case of Mercurial) proper support for
architectures for which data and code pointers don't have the
same size.
Differential Revision: https://phab.mercurial-scm.org/D7543
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Dec 2019 23:09:37 -0500] rev 43958
lfs: fix a discrepancy with a function wanting a filelog, but calling it rlog
This conceptually broke in
1541e1a8e87d when the filelog isa revlog relationship
was changed to containment of the revlog. It was made more obvious in
62a532045e71 and related API simplification.
It's resolved in favor of passing a revlog because the revlog verification code
doesn't have a reference to a filelog.
Differential Revision: https://phab.mercurial-scm.org/D7711
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Dec 2019 16:36:09 -0500] rev 43957
revlog: split the content verification of a node into a separate method
This will be used by LFS to tune what is skipped.
In the future, this could also be used by LFS to indicate which nodes tagged
with `skipread` are simply in need of a blob fetch, so that they can be done in
a batch later. (Currently, `skipread` also indicates censored data and errors.)
Additionally, it could be used to cache the sha1 hash value for each blob so
that large blobs don't need to be re-read and re-hashed if they are used by
multiple nodes.
Differential Revision: https://phab.mercurial-scm.org/D7710
Matt Harbison <matt_harbison@yahoo.com> [Sun, 22 Dec 2019 00:47:33 -0500] rev 43956
verify: update comment to say that lfs doesn't need fulltext to check renames
The reason is that `filelog.renamed()` indirectly calls `filelog.revision()`,
which is what accesses the full text. However, LFS wraps `filelog.renamed()`
and completely handles the case where an LFS blob is in play by using rawdata.
I've got a test to demonstrate that this is the case, and prevent regressions.
But the `skipread` flag is set on all lfs revisions when using `--no-lfs`,
regardless of whether or not the blobs are local. Just above this, that flag is
consulted, causing the rename checks to be skipped. That will need to be
loosened up first.
Differential Revision: https://phab.mercurial-scm.org/D7709
Martin von Zweigbergk <martinvonz@google.com> [Wed, 18 Dec 2019 13:30:48 -0800] rev 43955
resourceutil: use `from importlib import resources`
Without this patch, we get the following error from when trying to run
hg with PyOxidizer:
module 'importlib' has no attribute 'resources'
I don't know what why that happens, but `from importlib import
resources` is the form I would prefer anyway, so let's use that now
that the impoort-checker has been fixed.
Differential Revision: https://phab.mercurial-scm.org/D7701
Martin von Zweigbergk <martinvonz@google.com> [Wed, 18 Dec 2019 13:39:44 -0800] rev 43954
import-checker: allow all absolute imports of stdlib modules
Before this patch, we didn't allow imports like
from importlib import resources
(That's the reason I used `import importlib.resources` in D7629.)
I think that form is still an absolute import, so I don't think we
forbade on purpose.
Differential Revision: https://phab.mercurial-scm.org/D7700
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 22:36:40 -0500] rev 43953
help: drop a reference to Windows 9x
Differential Revision: https://phab.mercurial-scm.org/D7694
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 22:33:37 -0500] rev 43952
help: clarify that the Windows registry key for hgrc files is systemwide
Since there's no version or path info here to distinguish between installations,
it is effectively systemwide (unless splitting hairs about the WoW64 registry
redirection).
Differential Revision: https://phab.mercurial-scm.org/D7693
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 22:08:07 -0500] rev 43951
windows: add a global equivalent to /etc/mercurial for *.rc processing
This follows the Unix model of processing this directory immediately after
<internal>/*.rc, and prior to the installation relative files. Since the Unix
processing supports both a directory and a file (the former overriding the
latter), and since %HOME% supports both `*.ini` and `.hgrc` (again, the former
overriding the latter), this does too. The Unix file doesn't have a `.` prefix,
so it's not used here either.
Note that this is the opposite order of processing the exe relative paths. But
since it's in agreement with Unix, %HOME% and %USERPROFILE%, it seems reasonable
to ignore that. Maybe we can change that and take a BC, because that's
something the installer should be controlling, and I can't imagine people having
both paths *and* conflicting settings.
Differential Revision: https://phab.mercurial-scm.org/D7692
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 10:31:00 -0800] rev 43950
match: normalize `cwd` early
By having cwd in absolute form, we won't have to adjust it when
passing it to subrepo matchers. This will matter for a coming patch.
Differential Revision: https://phab.mercurial-scm.org/D7650
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 11:21:31 -0800] rev 43949
match: make sure `root` argument is always an absolute path (API)
The `root` argument should already be an absolute path, but we had
tests that passed a relative path. This patch fixes up the tests and
adds an assertion.
This assumes that `os.path.isabs('/repo')` will be `True` on all
platforms we care to run tests on. Augie tested for me that it does
work on Windows, so that's good enough for me.
Differential Revision: https://phab.mercurial-scm.org/D7649
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Dec 2019 20:29:02 -0500] rev 43948
tests: show that fileset patterns don't work with `fix` when not in repo root
Differential Revision: https://phab.mercurial-scm.org/D7569
Denis Laxalde <denis@laxalde.org> [Wed, 18 Dec 2019 20:17:21 +0100] rev 43947
py3: force bytestr conversion of "reason" in scmutil.callcatch()
For instance, reason may be an InvalidURL as shown in added test.
Georges Racinet <georges.racinet@octobus.net> [Fri, 20 Dec 2019 17:19:25 +0100] rev 43946
tests-pure: fixing test-parseindex2
This is a followup to D7603 (
49fa0b31ee1d) which broke
the tests for pure Python implementation. There are two
divergences between pure and C implementations:
- the pure implementation would accept only -1 as slice end,
whereas C accepts both -1 and len(index)
- in pure Python, `headrevs` is provided by revlog.py, not
by the index.
Differential Revision: https://phab.mercurial-scm.org/D7707
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 13 Dec 2019 19:59:59 +0100] rev 43945
rust-index: add a function to convert PyObject index for hg-core
Function in hg-core need something implementing the `Graph` trait. Right now,
the `hg-cpython` entry points directly turn the PyObject passed as argument
into a `cindex::Index`. However, if we start having the option to use an Index
in Rust, we need to dispatch between the different possible PyObject we could
receive.
So move the "duplicate" call into a unified function. When time come. It will be
easy to update the logic of all interface when the time come.
Differential Revision: https://phab.mercurial-scm.org/D7653
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Dec 2019 18:40:04 +0100] rev 43944
test: extract some generic data and utility from test-rust-ancestor.py
We will reuse this for more tests related to revlog index. In pratice this
series of changesets add an index implementation provided from Rust and we want
to be able to test it.
Differential Revision: https://phab.mercurial-scm.org/D7652
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 23:33:35 -0500] rev 43943
patch: fix header.__repr__() to not have `b''` prefixes in file names
Spotted by Denis Laxalde.
Differential Revision: https://phab.mercurial-scm.org/D7695
Martin von Zweigbergk <martinvonz@google.com> [Wed, 18 Dec 2019 11:11:40 -0800] rev 43942
cmdutil: allow native string as input to check_at_most_one_arg()
We seem to always convert **opts args to use bytes as keys early on in
Mercurial core, but I'm not sure we have good reason to do that, and
not all extensions do that. It's therefore helpful to be able to pass
in a native string to check_at_most_one_arg().
Differential Revision: https://phab.mercurial-scm.org/D7699
Martin von Zweigbergk <martinvonz@google.com> [Wed, 18 Dec 2019 10:52:49 -0800] rev 43941
cmdutil: return underscore-separate name from check_at_most_one_arg()
As noticed by Yuya, when I changed the function (during review) to
work with underscore-separated names as input, I forgot to make sure
the returned name was also underscore-separated. We don't have any
cases where it matters yet, but it should still clearly be fixed.
Instead of converting the hyphen-separated value we already have in
`previous`, I'm changing it so we convert to the underscore-separated
values to be hyphen-separated only when we need to display them. This
will also help a coming change where we allow the inputs to native
strings instead only bytes.
Differential Revision: https://phab.mercurial-scm.org/D7698
Martin von Zweigbergk <martinvonz@google.com> [Wed, 18 Dec 2019 10:55:06 -0800] rev 43940
rebase: restore i18n of a hint message
As noticed by Yuya, I lost the _() call in
71fee4564410 (rebase: use
rewriteutil.precheck() instead of reimplementing it, 2019-12-18).
Differential Revision: https://phab.mercurial-scm.org/D7697
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Wed, 18 Dec 2019 23:45:11 -0800] rev 43939
status: make unresolved files always be in the morestatus structured output
We don't know the status of those files, only that they're unresolved, so
we don't output the status for those - any code parsing this will have to be
tolerant to that.
Differential Revision: https://phab.mercurial-scm.org/D7668
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Wed, 18 Dec 2019 23:43:21 -0800] rev 43938
status: make morestatus call out unresolved conflicts after update
Differential Revision: https://phab.mercurial-scm.org/D7704
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Wed, 18 Dec 2019 23:41:36 -0800] rev 43937
status: extract active-merge state for reuse
Differential Revision: https://phab.mercurial-scm.org/D7667
Martin von Zweigbergk <martinvonz@google.com> [Tue, 17 Dec 2019 10:55:50 -0800] rev 43936
fix: use rewriteutil.precheck() instead of reimplementing it
Differential Revision: https://phab.mercurial-scm.org/D7687
Martin von Zweigbergk <martinvonz@google.com> [Tue, 17 Dec 2019 11:09:22 -0800] rev 43935
split: use rewriteutil.precheck() instead of reimplementing it
As you can see from the patch, I disagree with most of the comment
saying that `rewriteutil.precheck()` is not worthwhile.
Differential Revision: https://phab.mercurial-scm.org/D7686
Martin von Zweigbergk <martinvonz@google.com> [Wed, 18 Dec 2019 09:18:02 +0300] rev 43934
rebase: use rewriteutil.precheck() instead of reimplementing it
After this patch, there's still another place in `rebase.py`, in the
`--stop` code path, that reimplements `rewriteutil.precheck()`. I
couldn't fix that place because it `rewriteutil.precheck()` checks
that there is only one dirstate parent, which fails because we have
two parents at that point. I think it's incorrect that rebase leaves
the user with two parents during conflicts, but changing that is way
out of scope for this series.
Differential Revision: https://phab.mercurial-scm.org/D7685
Martin von Zweigbergk <martinvonz@google.com> [Tue, 17 Dec 2019 10:53:51 -0800] rev 43933
histedit: use rewriteutil.precheck() instead of reimplementing it
We have had this nice utility since
490df753894d (rewriteutil: add a
precheck function to check if revs can be rewritten, 2017-11-24). We
got two callers soon thereafter, in
98f97eb20597 (rewriteutil: use
precheck() in uncommit and amend commands, 2017-11-28). It's about
time we use it in other places.
rewriteutil.precheck() looks unfortunate for i18n (it seems to rely on
an English verb for the action making sense in other languages), but
hopefully not bad enough that we should avoid using it.
Differential Revision: https://phab.mercurial-scm.org/D7684
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:25:16 -0800] rev 43932
rebase: inline single-use variables passed to _definedestmap()
Differential Revision: https://phab.mercurial-scm.org/D7646
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:20:48 -0800] rev 43931
rebase: use cmdutil.check_at_most_one_arg() for action+revision
Differential Revision: https://phab.mercurial-scm.org/D7645
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:03:52 -0800] rev 43930
rebase: use cmdutil.check_incompatible_arguments() for --auto-orphans
Differential Revision: https://phab.mercurial-scm.org/D7644
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 22:43:15 -0800] rev 43929
rebase: use cmdutil.check_at_most_one_arg() for -b/-s/-r
Differential Revision: https://phab.mercurial-scm.org/D7643
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:11:33 -0800] rev 43928
rebase: inline single-use `dryrun` and `confirm` variables
Differential Revision: https://phab.mercurial-scm.org/D7642
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:50:42 -0800] rev 43927
rebase: use cmdutil.check_incompatible_arguments() for action+confirm/dryrun
Differential Revision: https://phab.mercurial-scm.org/D7661
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:49:48 -0800] rev 43926
rebase: use cmdutil.check_at_most_one_arg() for --confirm/--dry-run
I've also updated the helper to work with the hyphenated --dry-run
option.
Differential Revision: https://phab.mercurial-scm.org/D7641
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:25:54 -0500] rev 43925
windows: factor the hgrc directory scan into a function
Differential Revision: https://phab.mercurial-scm.org/D7691
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:21:36 -0500] rev 43924
windows: don't return early from building the hgrc search path
This will minimize the changes needed to add other sources.
Differential Revision: https://phab.mercurial-scm.org/D7690
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:15:59 -0500] rev 43923
windows: clarify a comment about the hgrc search path
The exe relative hgrc.d and the registry paths are not mutually exclusive.
Differential Revision: https://phab.mercurial-scm.org/D7689
Matt Harbison <matt_harbison@yahoo.com> [Tue, 17 Dec 2019 21:12:17 -0500] rev 43922
windows: drop detection of Windows 95/98/ME
Support was removed in python 2.6.
Differential Revision: https://phab.mercurial-scm.org/D7688
Augie Fackler <augie@google.com> [Tue, 17 Dec 2019 14:04:02 -0500] rev 43921
examples: add an example configuration for go source files
Tested by timeless.
Differential Revision: https://phab.mercurial-scm.org/D7683
Matt Harbison <matt_harbison@yahoo.com> [Sun, 15 Dec 2019 21:34:00 -0500] rev 43920
util: move common proxyobserver attributes to the base class
Fixes the following pytype warnings:
line 791, in _writedata: No attribute 'logdata' on baseproxyobserver [attribute-error]
line 792, in _writedata: No attribute 'logdataapis' on baseproxyobserver [attribute-error]
line 793, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 794, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 799, in _writedata: No attribute 'logdataapis' on baseproxyobserver [attribute-error]
line 800, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 802, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 803, in _writedata: No attribute 'name' on baseproxyobserver [attribute-error]
line 805, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 809, in _writedata: No attribute 'logdataapis' on baseproxyobserver [attribute-error]
line 810, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 814, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
line 815, in _writedata: No attribute 'name' on baseproxyobserver [attribute-error]
line 817, in _writedata: No attribute 'fh' on baseproxyobserver [attribute-error]
Differential Revision: https://phab.mercurial-scm.org/D7675
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 22:23:42 -0800] rev 43919
config: drop debug messages saying where config was read from
`hg config --debug` includes lines like this:
set config by: $EDITOR
but also lines like this:
$EDITOR: ui.editor=emacs -nw
The `set config by` messages don't seem to provide much additional
information over what we get from the `$EDITOR:`-type message. I could
imagine wanting to see which values got overriden by a later entry,
but that information is already not present. So let's just remove the
first type of output. My next patch would otherwise amplify the
redundant output (there would be one `set config by` for each line in
`mergetools.rc`).
Differential Revision: https://phab.mercurial-scm.org/D7627
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 11:22:37 -0800] rev 43918
rcutil: don't check if defaultrc/ is a directory -- we know it is
`mercurial/defaultrc/` is a directory both in the Mercurial repo and
once installed on a target platform. The directory was created in
c4ce077588d0 (config: introduce "built-in" default configuration
settings in default.d, 2014-09-04). That commit has some more
information, but it still doesn't seem to say that `defaultrc/` (then
called `default.d/`) could be a file. Perhaps the check was there to
allow you to run the same code on an older install/repo?
Differential Revision: https://phab.mercurial-scm.org/D7624
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:30:57 +0100] rev 43917
rust-matchers: add support for `exactmatcher` in `dirstate.status`
`exactmatcher` is the name in the Python implementation and corresponds to
`FileMatcher` in Rust.
Differential Revision: https://phab.mercurial-scm.org/D7531
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:30:10 +0100] rev 43916
rust-dirstate-status: update bridge for new rust version of `dirstate.status`
Differential Revision: https://phab.mercurial-scm.org/D7530
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:29:06 +0100] rev 43915
rust-dirstate-status: add `walk_explicit` implementation, use `Matcher` trait
This is the first time we actually use the `Matcher` trait, still for a small
subset of all matchers defined in Python.
While I haven't yet actually measured the performance of this, I have tried
to avoid any unnecessary allocations. This forces the use of heavy lifetimes
annotations which I am not sure we can simplify, although I would be happy
to be proven wrong.
Differential Revision: https://phab.mercurial-scm.org/D7529
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 18:54:06 +0100] rev 43914
rust-matchers: add `FileMatcher` implementation
Mercurial defines an `exactmatcher`, I find `FileMatcher` to be clearer, but
am not opposed to using the old name.
This change also switched the order of `assert_eq` arguments as it is clearer
that way for most people.
Differential Revision: https://phab.mercurial-scm.org/D7528
Matt Harbison <matt_harbison@yahoo.com> [Thu, 12 Dec 2019 12:30:15 -0500] rev 43913
exchange: ensure all outgoing subrepo references are present before pushing
We've run into occasional problems with people committing a repo, and then
amending or rebasing in the subrepo. That makes it so that the revision in the
parent can't be checked out, and the problem gets propagated on push. Mercurial
already tries to defend against this sort of dangling reference by pushing *all*
subrepo revisions first. This reuses the checks that trigger warnings in
`hg verify` to bail on the push unless using `--force`.
I thought about putting this on the server side, but at that point, all of the
data has been transferred, only to bail out. Additionally, SCM Manager hosts
subrepos in a location that isn't nested in the parent, so normal subrepo code
would complain that the subrepo is missing when run on the server.
Because the push command pushes subrepos before calling this exchange code, a
subrepo will be pushed before the parent is verified. Not great, but no
dangling references are exchanged, so it solves the problem. This code isn't in
the loop that pushes the subrepos because:
1) the list of outgoing revisions is needed to limit the scope of the check
2) the loop only accesses the current revision, and therefore can miss
subrepos that were dropped in previous commits
3) this code is called when pushing a subrepo, so the protection is recursive
I'm not sure if there's a cheap check for the list of files in the outgoing
bundle. If there is, that would provide a fast path to bypass this check for
people not using subrepos (or if no subrepo changes were made). There's
probably also room for verifying other references like tags. But since that
doesn't break checkouts, it's much less of a problem.
Differential Revision: https://phab.mercurial-scm.org/D7616
Augie Fackler <augie@google.com> [Thu, 05 Dec 2019 16:19:16 -0500] rev 43912
procutil: try and avoid angering CoreFoundation on macOS
We've seen failures like this:
objc[57662]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[57662]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
I think this is due to forking off some background processes during
`hg update` or similar. I don't have any conclusive proof this is the
fork() call that's to blame, but it's the most likely one since the
regular `hg update` codepath uses the other fork() invocation (via
workers) and we don't get this report from non-Google macOS users.
Ugh.
Differential Revision: https://phab.mercurial-scm.org/D7615
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Dec 2019 17:35:29 +0100] rev 43911
nodetree: simplify a conditionnal in shortesthexnodeidprefix
instead of try to catch some attribute error, we could just nicely look if the
attribute will be available. This make the code simpler to follow and less error
prone since we no longer rely on a wider attribute catching.
Differential Revision: https://phab.mercurial-scm.org/D7651
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 15:06:09 -0800] rev 43910
config: close file even if we fail to read it
If we get an exception from cfg.read(), we would not close the file
before this patch. This patch uses a context manager to make sure we
close it.
Differential Revision: https://phab.mercurial-scm.org/D7626
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 15:33:07 -0800] rev 43909
config: catch intended exception when failing to parse config
When a new config parser was introduced in
fca54469480e (ui: introduce
new config parser, 2009-04-23), the reading side would raise a
ConfigError which was then caught in the ui code. Then, in
2123aad24d56 (error: add new ParseError for various parsing errors,
2010-06-04), a ParseError was raised instead, but the call site was
not updated. Let's start catching that ParseError. We still don't
print it in a friendly way, but that's not worse than before.
Differential Revision: https://phab.mercurial-scm.org/D7625
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 09:39:14 -0800] rev 43908
rust-hg-path: implement more readable custom Debug for HgPath{,Buf}
The default prints the vector of bytes as a list of integers. I
considered instead getting rid of the Debug trait, but we use the
Debug format in lots of derived Debug instances, so we probably do
want to implement it.
Differential Revision: https://phab.mercurial-scm.org/D7604
Martin von Zweigbergk <martinvonz@google.com> [Mon, 16 Dec 2019 15:58:47 -0800] rev 43907
util: implement sortdict.insert()
As flagged by pytype (reported via Matt Harbison, thanks). This was
broken by
bd0fd3ff9916 (util: rewrite sortdict using Python 2.7's
OrderedDict, 2017-05-16). We actually call insert() on
namespaces.py:100, but we clearly don't have test coverage of that an
no users have reported it AFAIK.
Differential Revision: https://phab.mercurial-scm.org/D7680
Matt Harbison <matt_harbison@yahoo.com> [Mon, 16 Dec 2019 23:27:17 -0500] rev 43906
patch: make __repr__() return str
Caught by pytype:
line 969, in __repr__: Function bytes.join was called with the wrong arguments [wrong-arg-types]
Expected: (self, iterable: Iterable[bytes])
Actually passed: (self, iterable: Iterator[str])
Differential Revision: https://phab.mercurial-scm.org/D7682
Matt Harbison <matt_harbison@yahoo.com> [Sun, 15 Dec 2019 23:46:10 -0500] rev 43905
pytype: suppress warnings about no 'open_binary' on importlib.resources
Fixes these pytype warnings:
line 43, in <module>: No attribute 'open_binary' on module 'importlib.resources' [module-attr]
line 47, in open_resource: No attribute 'open_binary' on module 'importlib.resources' [module-attr]
For some reason, I can't upgrade from 3.6.8 in my WSL environment.
Differential Revision: https://phab.mercurial-scm.org/D7681
Augie Fackler <augie@google.com> [Mon, 16 Dec 2019 17:10:51 -0500] rev 43904
windows: if username(uid=None) is loaded, just use getpass
This is at least consistent with what we do on other platforms in the
base case. I don't know enough about Windows to fill in other cases
that might exist here, but this at least should be a start.
Differential Revision: https://phab.mercurial-scm.org/D7679
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:12:14 -0800] rev 43903
transplant: use check_incompatible_arguments()
Differential Revision: https://phab.mercurial-scm.org/D7663
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:31:51 -0800] rev 43902
bookmarks: use check_incompatible_arguments() for inactive+action
Differential Revision: https://phab.mercurial-scm.org/D7662
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:32:47 -0800] rev 43901
bookmarks: use cmdutil.check_incompatible_arguments() for action+rev
Differential Revision: https://phab.mercurial-scm.org/D7648
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:31:17 -0800] rev 43900
bookmarks: use cmdutil.check_at_most_one_arg() for action
Differential Revision: https://phab.mercurial-scm.org/D7647
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:55:33 -0800] rev 43899
rebase: use cmdutil.check_at_most_one_arg() for action
Here we also needed to know what the action was (if any), so I've
updated the helper to return any specified option.
Differential Revision: https://phab.mercurial-scm.org/D7640
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 22:30:59 -0800] rev 43898
releasenotes: extract helper for checking for incompatible arguments
This patch extracts a new check_incompatible_arguments() function
similar to check_at_most_one_arg(). The difference is that the new
function is for checking for arguments that are disallowed together
with some other argument but not mutually exclusive among themselves.
Differential Revision: https://phab.mercurial-scm.org/D7639
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:51:09 -0800] rev 43897
fix: use cmdutil.check_at_most_one_arg()
Differential Revision: https://phab.mercurial-scm.org/D7638
Martin von Zweigbergk <martinvonz@google.com> [Tue, 17 Dec 2019 10:26:44 +0300] rev 43896
patchbomb: use cmdutil.check_at_most_one_arg()
Differential Revision: https://phab.mercurial-scm.org/D7637