Kyle Lippincott <spectral@google.com> [Wed, 11 Dec 2019 19:42:05 -0800] rev 43879
merge: add commands.merge.require-rev to require an argument to hg merge
This is related to commands.rebase.requiredest, commands.update.requiredest, and
commands.push.require-revs. Since it isn't really a "destination", I went with
require-rev to be similar to push's require-revs.
Differential Revision: https://phab.mercurial-scm.org/D7620
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 09:59:03 -0800] rev 43878
tests: make test-config-env.py a little less hacky
Overriding os.path.isdir to always returns False is very
confusing. Let's make it more explicit by specifically not returning
any defaultrc/ configs.
Differential Revision: https://phab.mercurial-scm.org/D7623
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 12:57:13 -0800] rev 43877
help: get helptext/ data from `resources` module if available
For PyOxidizer, we need to read configs using the `resources`
module. This patch makes it so we use that module if available
(i.e. Python >= 3.7). It does that by adding a new `open_resource()`
function to our `resourceutil` module.
Tested by running `$PYTHON ./hg help pager` for each $PYTHON in
{python2, python3.6, python3.7}.
Differential Revision: https://phab.mercurial-scm.org/D7622
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 10:26:09 -0800] rev 43876
pycompat: allow pycompat.sysbytes() even if input already is bytes
pycompat.sysstr() on py3 accepts an input that's already str
(i.e. unicode). This patch makes it so pycompat.sysbytes() on py3
accepts an input that's already bytes. Allowing that makes it possible
to do pycompat.sysbytes(fp.name) where fp.name is either bytes or
unicode, as we'll get when fp can come from either open() or
resources.open_binary().
Differential Revision: https://phab.mercurial-scm.org/D7621
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 10:10:40 -0800] rev 43875
merge with stable
Raphaël Gomès <rgomes@octobus.net> [Thu, 12 Dec 2019 15:55:25 +0100] rev 43874
rust-dirs: handle forgotten `Result`s
In 1fe2e574616e I introduced a temporary bugfix to align Rust code with a new
behavior from C/Python and forgot about a few `Result`s (cargo's compiler cache
does not re-emit warnings on cached modules). This fixes it.
For the record, I am still unsure that this behavior change is a good idea.
Note: I was already quite unhappy with the setters and getters for the
`DirstateMap` and, indirectly, `Dirs`, and this only further reinforces my
feelings. I hope we can one day fix that situation at the type level; Georges
Racinet and I were just talking about devising a POC for using the builder
pattern in the context of FFI with Python, we'll see what comes out of it.
Differential Revision: https://phab.mercurial-scm.org/D7609
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 09:43:43 -0800] rev 43873
merge with stable
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 09 Dec 2019 22:24:58 -0800] rev 43872
status: outputting structured unfinished-operation information
This adds a new item in the json/template output for morestatus and added item
types to all entries.
Differential Revision: https://phab.mercurial-scm.org/D7595
Kyle Lippincott <spectral@google.com> [Thu, 05 Dec 2019 14:28:21 -0800] rev 43871
chg: fix chg to work with py3.7+ "coercing" the locale
When the environment is empty (specifically: it doesn't contain LC_ALL,
LC_CTYPE, or LANG), Python will "coerce" the locale environment variables to be
a UTF-8 capable one. It sets LC_CTYPE in the environment, and this breaks chg,
since chg operates by:
- start hg, using whatever environment the user has when chg starts
- hg stores a hash of this "original" environment, but python has already set
LC_CTYPE even though the user doesn't have it in their environment
- chg calls setenv over the commandserver. This clears the environment inside of
hg and sets it to be exactly what the environment in chg is (without
LC_CTYPE).
- chg calls validate to ensure that the environment hg is using (after the
setenv call) is the one that the chg process has - if not, it is assumed the
user changed their environment and we should use a different server. This will
*never* be true in this situation because LC_CTYPE was removed.
Differential Revision: https://phab.mercurial-scm.org/D7550
Augie Fackler <augie@google.com> [Mon, 09 Dec 2019 22:20:35 -0500] rev 43870
fuzz: add support for fuzzing under either Python 2 or 3
This was more of a hairball than I hoped, but it appears to work. The hg-py3
branch of my oss-fuzz fork on github has the remaining changes to switch us to
Python 3, but we may as well retain Python 2 fuzzing support for at least a
little while.
Differential Revision: https://phab.mercurial-scm.org/D7592
Matt Harbison <matt_harbison@yahoo.com> [Fri, 22 Nov 2019 23:43:59 -0500] rev 43869
phabricator: color the status in the "phabstatus" view
I couldn't figure out strikethrough for "abandoned" like I've see with word
diff.
Differential Revision: https://phab.mercurial-scm.org/D7608
Matt Harbison <matt_harbison@yahoo.com> [Wed, 11 Dec 2019 23:16:42 -0500] rev 43868
phabricator: add the "Changes Planned" status name
I noticed this when coloring the status output. But it looks like status names
are also used in the pseudo revset language as well, and abort when parsing a
name not in this list.
Differential Revision: https://phab.mercurial-scm.org/D7607
Kyle Lippincott <spectral@google.com> [Wed, 11 Dec 2019 15:23:54 -0800] rev 43867
fuzz: fix mpatch_corpus to not have an overridden __repr__ on py3
Differential Revision: https://phab.mercurial-scm.org/D7606
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 10:00:24 -0800] rev 43866
formatting: fix some recent formatting regressions
Differential Revision: https://phab.mercurial-scm.org/D7605
Georges Racinet <georges.racinet@octobus.net> [Thu, 05 Dec 2019 20:41:23 +0100] rev 43865
cext-revlog: fixed __delitem__ for uninitialized nodetree
This is a bug in a code path that's seldom used, because in practice
(at least in the whole test suite), calls to `del index[i:j]` currently
just don't happen before the nodetree has been initialized.
However, in our current work to replace the nodetree by a Rust implementation,
this is of course systematic.
In `index_slice_del()`, if the slice start is smaller than `self->length`,
the whole of `self->added` has to be cleared.
Before this change, the clearing was done only by the call to
`index_invalidate_added(self, 0)`, that happens only for initialized
nodetrees. Hence the removal was effective only from `start` to `self->length`.
The consequence is index corruption, with bogus results in subsequent calls,
and in particular errors such as `ValueError("parent out of range")`, due to
the fact that parents of entries in `self->added` are now just invalid.
This is detected by the rebase tests, under conditions that the nodetree
of revlog.c is never initialized. The provided specific test is more direct.
Differential Revision: https://phab.mercurial-scm.org/D7603