Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 09 Dec 2019 22:24:58 -0800] rev 43861
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 43860
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 43859
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 43858
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 43857
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 43856
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 43855
formatting: fix some recent formatting regressions
Differential Revision: https://phab.mercurial-scm.org/D7605
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Dec 2019 12:29:46 +0100] rev 43854
remotefilelog: remove the `ensurestart` usage
The option does not seems to do what we want since it does not wait on the background
process actually starting (eg: taking the lock). And the race have been dealt
with another way anyway.
This effectively back out changeset
2c74337e6483.
Differential Revision: https://phab.mercurial-scm.org/D7590
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Dec 2019 11:26:53 +0100] rev 43853
remotefilelog: remove most of the debugwait* command in the tests
Since we use a dedicated developer config, we do not need them anymore.
Differential Revision: https://phab.mercurial-scm.org/D7589
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Dec 2019 11:45:17 +0100] rev 43852
remotefilelog: use the correct redirection in tests
The test were using '2>%1' which just redirect stderr in the "%1" file. The
intend was '2>&1' which redirect stderr on stdin.
This impact tests because some commit were picking up this '%1' files.
Differential Revision: https://phab.mercurial-scm.org/D7588
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Dec 2019 10:09:40 +0100] rev 43851
remotefilelog: remove most sleep in tests
Now that we removed most of the races, we can remove the infamous sleeps.
Differential Revision: https://phab.mercurial-scm.org/D7587
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Dec 2019 09:57:34 +0100] rev 43850
remotefilelog: have command wait for background task in the tests
We leverage the feature introduced in the two previous commit to have the main
command wait for the background task to be finished before returning.
All test still pass and instability seems to have gone away.
Most of the sleep and explicit wait are now useless and will be cleaned up in
later changesets.
Differential Revision: https://phab.mercurial-scm.org/D7586
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Dec 2019 09:54:27 +0100] rev 43849
remotefilelog: add a developer option to wait for background processes
In order to block the main command on the subprocess exiting, we ensure the
repo's ui object will call the subprocess.wait() method to ensure the top-level
hg process doesn't exit until all background processes have also done so.
Currently, in the tests, most operation spawning background process as followed
by commands waiting for these operations to complete. However this waiting is
racy. First because it seems like we can start waiting before the background
operation actually start, in which case it is prematurely detected as "done".
Second, because some commands may spawn multiple background operation for the
same operation (eg: rebase can apparently trigger multiple prefetch). The
current approach could be updated to maybe handle the first issue, but the
second one will never be properly handled.
In most case, we do not care that the bg process keep running after the command
end. (Since we explicitly wait for them to end before doing anything else). So
we add an option to wait on the background process before exiting the command.
We'll put it in use in the next changeset.
Differential Revision: https://phab.mercurial-scm.org/D7585
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 09 Dec 2019 09:53:43 +0100] rev 43848
procutil: add a option to not fully detach background process
When writing test, it is useful to make code pretending to spawn a fully
detached process while still actually waiting for it to finish. We add the
option to `procutil.runbgcommand`, to do so. We will use this in remote-filelog
tests.
Differential Revision: https://phab.mercurial-scm.org/D7584
Georges Racinet <georges.racinet@octobus.net> [Thu, 05 Dec 2019 20:41:23 +0100] rev 43847
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
Matt Harbison <matt_harbison@yahoo.com> [Wed, 20 Nov 2019 13:03:22 -0500] rev 43846
filemerge: fix a missing attribute usage
Flagged by both pytype and VSCode.
Differential Revision: https://phab.mercurial-scm.org/D7465
Matt Harbison <matt_harbison@yahoo.com> [Wed, 20 Nov 2019 13:01:56 -0500] rev 43845
filemerge: drop a default argument to appease pytype
The function slices and takes the length of this argument without internally
setting it if not provided. There was no bug here because both callers passed
the argument.
Differential Revision: https://phab.mercurial-scm.org/D7464
Augie Fackler <augie@google.com> [Tue, 10 Dec 2019 19:04:53 -0500] rev 43844
fuzz: add a seed corpus for the dirs fuzzer
I was hoping to trigger an asan violation under Python 3 that some internal
tests at Google found, but for some reason that's beyond me I can't seem to
manage.
Differential Revision: https://phab.mercurial-scm.org/D7600
Augie Fackler <augie@google.com> [Tue, 10 Dec 2019 19:04:08 -0500] rev 43843
fuzz: clean up production of seed corpora
This was getting out of hand.
Differential Revision: https://phab.mercurial-scm.org/D7599
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 09 Dec 2019 22:06:55 -0800] rev 43842
status: add template/json data about whether a file has unresolved conflicts
Differential Revision: https://phab.mercurial-scm.org/D7594
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 09 Dec 2019 18:15:38 -0800] rev 43841
status: split morestatus data loading from display
This is a small refactoring in preparation for adding more morestatus
functionality (notably for templated/JSON output) - the goal is to
use the data inside the status display loop, as well as output the
overall state in a templatable/structured way.
Differential Revision: https://phab.mercurial-scm.org/D7593
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 21 Nov 2019 16:54:00 +0100] rev 43840
phabricator: add a "phabstatus" template keyword
We add a "phabstatus" template keyword, returning an object with "url"
and "status" keys. This is quite similar to "phabreview" template
keyword, but it queries phabricator for each specified revision so it's
going to be slow (as compared to the "phabstatus" show view from
previous changeset).
Differential Revision: https://phab.mercurial-scm.org/D7507
Denis Laxalde <denis@laxalde.org> [Sat, 23 Nov 2019 11:04:19 +0100] rev 43839
phabricator: add a "phabstatus" show view
We add a "phabstatus" show view (called as "hg show phabstatus") which
renders a dag with underway revisions associated with a differential
revision and displays their status.
The revisions shown is a subset of that shown by "work" view, only
including revisions with known by Phabricator.
Differential Revision: https://phab.mercurial-scm.org/D7506
Martin von Zweigbergk <martinvonz@google.com> [Tue, 10 Dec 2019 14:40:44 -0800] rev 43838
dirs: fix out-of-bounds access in Py3
The hack for mutating Python's variable-length integers that was
ported to py3 in
cb3048746dae (dirs: port PyInt code to work on Python
3, 2016-10-08) was reading from ob_digit[1] instead of ob_digit[0] for
some reason. Space for ob_digit[1] would only be allocated for
integers larger than 30 bits, so we ended up writing to unallocated
memory. Also, we would write an integer that's 2^30 times too large,
so we would never free these integers.
Found by AddressSanitizer.
Differential Revision: https://phab.mercurial-scm.org/D7597
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 11 Dec 2019 11:16:12 +0100] rev 43837
manifestcache: add some test involving shares
Some issue around shares have been reported. I am adding tests to better cover
the share case. The test show that the code behave as expected so far.
Differential Revision: https://phab.mercurial-scm.org/D7602
Kyle Lippincott <spectral@google.com> [Tue, 10 Dec 2019 16:17:36 -0800] rev 43836
fuzz: fix test-fuzz-targets.t to run with python3
Differential Revision: https://phab.mercurial-scm.org/D7601
Kyle Lippincott <spectral@google.com> [Tue, 10 Dec 2019 15:29:58 -0800] rev 43835
py3: fix a bytes vs str issue in remotefilelog extension
Differential Revision: https://phab.mercurial-scm.org/D7598
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 18:53:52 +0100] rev 43834
rust-matchers: add doctests for `AlwaysMatcher`
Differential Revision: https://phab.mercurial-scm.org/D7527
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:24:40 +0100] rev 43833
rust-hg-path: add method to get part of a path relative to a prefix
This will be used in the next patch in this series.
Differential Revision: https://phab.mercurial-scm.org/D7526
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 18:33:56 +0100] rev 43832
rust-matchers: improve `Matcher` trait ergonomics
`VisitChildrenSet` has no need to own the set, this will save allocations.
The `file_set` return type change is motivated by both ergonomics and... being
able to compile code.
The `AlwaysMatcher` does not store a `file_set`, which requires it to return an
owned `HashSet`, which in turn would change our return type to `Cow<&HgPath>`
(lifetimes omitted). This is both un-ergonomic and troublesome for more
complex lifetime issues (especially with the upcoming `FileMatcher` in the
following patch).
Differential Revision: https://phab.mercurial-scm.org/D7525