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
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:19:34 +0100] rev 43831
rust-dirs-multiset: use `AsRef` instead of concrete types when possible
I also renamed `vec` to `dirstate`, because it was not a great name.
Differential Revision: https://phab.mercurial-scm.org/D7524
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 21 Nov 2019 16:48:34 +0100] rev 43830
logcmdutil: call _exthook() in changesettemplater
Class changesetprinter has an _exthook() method that is called in
_show() before the patch is displayed. Call the method as well in
changesettemplater._show().
Differential Revision: https://phab.mercurial-scm.org/D7505
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 21 Nov 2019 18:10:12 +0100] rev 43829
phabricator: fix processing of tags/desc in getoldnodedrevmap()
It seems that the previous logic was wrong (it essentially comes
from changeset
3ab0d5767b54 where the result got accumulated instead of
early returned).
First of all, the "continue" in first "if m:" is useless because we're
at the end of the loop. Then, the algorithm seems weird because we will
process all predecessors of a node and possibly override
`toconfirm[node]` for each of these having a tag (maybe this doesn't
happen, but still). Finally, we would also override `toconfirm[node]`
when the "Differential Revision: " is found in changeset description.
Maybe this is not a big deal when there is no mix of local tag and
changeset description update?
The logic is changed so that the loop on predecessors stops upon first
match of a tag and so that the changeset description is only checked if
no tag was found. Therefore, `toconfirm[node]` is only set once.
Differential Revision: https://phab.mercurial-scm.org/D7513
Augie Fackler <augie@google.com> [Tue, 10 Dec 2019 10:31:18 -0500] rev 43828
tests: replace [[]] bashism with portable [] invocation
In this case nothing fancy is required.
Differential Revision: https://phab.mercurial-scm.org/D7596
Raphaël Gomès <rgomes@octobus.net> [Fri, 29 Nov 2019 17:15:24 +0100] rev 43827
rust-hg-path: implement `Display` for `HgPath` and `HgPathBuf`
This is useful when debugging, to get a human readable output instead of an
array of `u8`.
Differential Revision: https://phab.mercurial-scm.org/D7523
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Oct 2019 13:57:30 +0200] rev 43826
rust-performance: introduce FastHashMap type alias for HashMap
Rust's default hashing is slow, because it is meant for preventing collision
attacks.
For all of the current Rust code, we don't care about those attacks, because
if an person with bad intentions has write access to your repo, you have other
issues.
I've chosen to use the TwoXHash crate because it was made by a reputable member
of the Rust community and has very good benchmarks.
For now it does not seem to improve performance by much for the current code,
but it's something else to not worry about when benchmarking code: in a
previous experiment with copytracing in Rust, it accounted for more than 10%
of the time of the entire script.
Differential Revision: https://phab.mercurial-scm.org/D7116
Julien Cristau <jcristau@debian.org> [Mon, 02 Dec 2019 14:44:26 +0100] rev 43825
mail: use procutil.shellsplit instead of bytes.split to parse command
Differential Revision: https://phab.mercurial-scm.org/D7541
Augie Fackler <augie@google.com> [Thu, 05 Dec 2019 16:18:44 -0500] rev 43824
annotate: describe --skip as taking a revset
It's obvious to me, but probably wouldn't be obvious to a novice user.
Differential Revision: https://phab.mercurial-scm.org/D7557
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Dec 2019 17:42:38 -0800] rev 43823
automation: use latest Windows AMI as base
It looks like the previous base image no longer exists. I guess
Amazon expires them or something. Let's switch to the newest version
of the equivalent image.
Differential Revision: https://phab.mercurial-scm.org/D7571
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Dec 2019 23:49:03 -0500] rev 43822
tests: stabilize test-extdiff.t on Windows
This goes with
765a9c299c44. I'm not sure if we care about the missing file
being spelled `nul`, so I removed it from the glob to be explicit about it. The
line needed to be special cased anyway because of the quoting on Windows.
Differential Revision: https://phab.mercurial-scm.org/D7572
Matt Harbison <matt_harbison@yahoo.com> [Sat, 07 Dec 2019 22:09:43 -0500] rev 43821
exchange: fix an attempt to format a list into bytes
This goes with
27c6d6f53d46.
Differential Revision: https://phab.mercurial-scm.org/D7583
Martin von Zweigbergk <martinvonz@google.com> [Mon, 09 Dec 2019 09:50:39 -0800] rev 43820
status: remove pointless filtering by alwaysmatcher in morestatus
The code has been like this since it was imported from FB's
hg-experimental repo. It has been like that even since it was added in
that repo. So I don't know why it looks that way. Perhaps the idea was
to one day filter the unresolved paths by any patterns provided by the
user. We can add a matcher back if we ever decide to do that.
Differential Revision: https://phab.mercurial-scm.org/D7591
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 07 Dec 2019 13:07:25 -0800] rev 43819
tests: add test for Rust formatting
We enforce formatting for Python and C. It makes sense to do it
for Rust as well.
Since our rustfmt.toml relies on unstable rustfmt features, we
need to use a Nightly rustfmt with --unstable-features in order
for it to work. This is a bit hacky and I would prefer we remove
this requirement. But for now, this commit assumes this is the
way things must be and we go out of our way to detect and use the
rustfmt from the "nightly" toolchain, as installed via rustup.
We had to add some environment variables to the tests to make
the Rust binaries happy. Otherwise when running rustfmt we get
an error about no default toolchain being installed.
Differential Revision: https://phab.mercurial-scm.org/D7579
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 07 Dec 2019 13:06:25 -0800] rev 43818
rust: run rustfmt
# skip-blame automated reformatting
Differential Revision: https://phab.mercurial-scm.org/D7578
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 16:09:03 -0500] rev 43817
fuzz: clean up some repetition on building parsers.so fuzzers
There was a lot of repetition here that I realized could be cleared out. I
think there's some more work we could do here, but this is enough for now.
Differential Revision: https://phab.mercurial-scm.org/D7568
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:21:45 -0500] rev 43816
fuzz: remove legacy setup for running fuzzers outside oss-fuzz
We don't need this anymore.
Differential Revision: https://phab.mercurial-scm.org/D7567
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:08:37 -0500] rev 43815
tests: finally fix up test-fuzz-targets.t
It's been failing on my workstation for a while, since I have a new enough
LLVM that I had the fuzzer goo, but not so new that I actually had
FuzzedDataProvider. This is a better solution all around in my opinion.
I _believe_ this should let us run these tests on most systems, even
those using GCC instead of clang. That said, my one attempt to test
this on my macOS laptop failed miserably, and I don't feel like doing
more work on this right now.
Differential Revision: https://phab.mercurial-scm.org/D7566
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:07:06 -0500] rev 43814
fuzz: make standalone_fuzz_target_runner call LLVMFuzzerInitialize
Otherwise some of our fuzzers crash when they try and use Python.
Differential Revision: https://phab.mercurial-scm.org/D7565
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:19:47 -0500] rev 43813
fuzz: use a more standard approach to allow local builds of fuzzers
This is taken from the (improved since we started fuzzing) guide on ideal
integrations. Rather than have our own wonky targets for building outside the
fuzzer universe, we have a driver program we carry along and use when we're
not using LibFuzzer. This will let us jettison a fair amount of goo.
contrib/fuzz/standalone_fuzz_target_runner.cc is
https://github.com/google/oss-fuzz/ file
projects/example/my-api-repo/standalone from git revision
c4579d9358a73ea5dbcc99cb985de1f2bf76dcf7, reformatted with out
clang-format settings and a no-check-code comment added. It allows
running a single test input through a fuzzer, rather than performing
ongoing fuzzing as libfuzzer would.
contrib/fuzz/FuzzedDataProvider.h is
https://github.com/llvm/llvm-project/ file
/compiler-rt/include/fuzzer/FuzzedDataProvider.h from git revision
a44ef027ebca1598892ea9b104d6189aeb3bc2f0, reformatted with our
clang-format settings and a no-check-code comment added. We can
discard this if we instead want to add an hghave check for a new
enough llvm that includes FuzzedDataProvder.h in the fuzzer headers.
Differential Revision: https://phab.mercurial-scm.org/D7564
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:15:05 -0500] rev 43812
fuzz: use a variable to allow specifying python-config to use
Eventually we should probably default this to just `python-config` and have
the oss-fuzz build.sh script specify the sanpy python-config, but for now this
lets us make progress.
Differential Revision: https://phab.mercurial-scm.org/D7563
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:13:25 -0500] rev 43811
fuzz: suppress deprecated-register warnings in our compile
These come from the Python.h headers still using the `register`
keyword and our use of C++17. I think this will go away when we're
using Python 3 for our fuzzing, but that can come later.
Differential Revision: https://phab.mercurial-scm.org/D7562
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:12:00 -0500] rev 43810
fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE
This will make our lives easier in an upcoming change, but it's also how we're
supposed to set things up anyway.
Differential Revision: https://phab.mercurial-scm.org/D7561
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:05:34 -0500] rev 43809
fuzz: always define LLVMFuzzerInitialize() even if we don't need it
This will make it easier to test our fuzzers outside oss-fuzz.
Differential Revision: https://phab.mercurial-scm.org/D7560
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:06:10 -0500] rev 43808
fuzz: remove debug prints from revlog_corpus.py
Differential Revision: https://phab.mercurial-scm.org/D7559
Augie Fackler <augie@google.com> [Fri, 06 Dec 2019 15:30:29 -0500] rev 43807
fuzz: fix an unused result on getcwd() in pyutil
clang was rightly complaining about this, so let's just fix it.
Differential Revision: https://phab.mercurial-scm.org/D7558
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 29 Sep 2019 16:00:32 +0200] rev 43806
upgraderepo: add a config option for parallel computation
The option is put to use to compute new copy tracing side data in parallel. It
use the multiprocessing module as it had the appropriate primitive for what we
needed. Gregory Szorc had concerned on windows so we disabled it there.
See inline comment for details on the parallel implementation.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 29 Nov 2019 15:36:45 +0100] rev 43805
upgrade-repo: colorize some of the output
Having clear color for requirement added and removed is useful.
Paul Sonnenschein <paul@sonnenschein.ruhr> [Fri, 06 Dec 2019 15:30:06 +0100] rev 43804
tests: remove hardcoded errno values
Fixes test failures on hurd-i386
Ref: https://bugs.debian.org/946178
Differential Revision: https://phab.mercurial-scm.org/D7556
Kyle Lippincott <spectral@google.com> [Thu, 05 Dec 2019 15:50:47 -0800] rev 43803
tests: expect return status 255 on exception for test-blackbox.t with chg
Differential Revision: https://phab.mercurial-scm.org/D7554
Kyle Lippincott <spectral@google.com> [Thu, 05 Dec 2019 14:18:39 -0800] rev 43802
tests: fix command name in test-blackbox.t to be bytes
This command is only used when tests are run with --with-chg, so this was missed
before.
Differential Revision: https://phab.mercurial-scm.org/D7553
Kyle Lippincott <spectral@google.com> [Thu, 05 Dec 2019 14:01:26 -0800] rev 43801
tests: fix deprecation warning about regex flags not at beginning of expr
This may only show up when running the tests under python3.6+. Currently the
only test that does this is test-patchbomb-tls.t, and it only uses (?i), so
that's all that's handled at the moment.
Differential Revision: https://phab.mercurial-scm.org/D7552
Kyle Lippincott <spectral@google.com> [Thu, 05 Dec 2019 13:48:36 -0800] rev 43800
tests: fix test-chg.t to work with py3 (no setprocname)
Differential Revision: https://phab.mercurial-scm.org/D7551
Kyle Lippincott <spectral@google.com> [Tue, 26 Nov 2019 16:10:21 -0800] rev 43799
amend: check for file modifications when updating dirstate (
issue6233)
Previously, we called dirstate.normal(f), which would put information into the
dirstate claiming that the file on disk is what it "should be" for the current
checkout, and it would have the size and timestamp of the most recent
modification to the file (which is not necessarily the one we just committed).
If the file was modified while the commit message editor was open, we would put
incorrect information into the dirstate.
Differential Revision: https://phab.mercurial-scm.org/D7521
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Dec 2019 09:39:49 -0800] rev 43798
graft: never set both parents equal in the dirstate (
issue6098)
merge.graft() can set both parents equal in the dirstate when
keepparent=True. We don't seem to set that in core, but the evolve
extension does use it. So I couldn't figure out a way to add a test
for this patch in core.
Differential Revision: https://phab.mercurial-scm.org/D7549
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Dec 2019 09:34:43 -0800] rev 43797
graft: extract `repo['.']` to local variable
It's used in two places and I'm about to use it more.
Differential Revision: https://phab.mercurial-scm.org/D7548
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Dec 2019 09:32:47 -0800] rev 43796
graft: rename `pctx` argument to `base` since that's what it is
The new name better matches the docstring. It also frees up `pctx` to
be used for something else (next patch).
Differential Revision: https://phab.mercurial-scm.org/D7547