Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 06:09:44 +0100] rev 40786
mmapindex: set default to 1MB
mmapping index is more efficient if we only need a small part of it.
The 1MB value has been picked arbitrarily, a lower value might be better.
On a large repository with a 60MB index, we see the following performance
gain:
hg perfindex
before: ! wall 0.032023 comb 0.040000 user 0.000000 sys 0.040000 (best of 100)
after: ! wall 0.000196 comb 0.000000 user 0.000000 sys 0.000000 (best of 1060)
The speed boost benefit all cases, including the one where the full index
needs to be parsed.
hg perfindex --rev 0
before: ! wall 0.040673 comb 0.030000 user 0.000000 sys 0.030000 (best of 100)
after ! wall 0.010713 comb 0.020000 user 0.010000 sys 0.010000 (best of 212)
This gain reflect in higher level operation:
hg perfbookmarks --clear-revlogs
before: ! wall 0.161339 comb 0.160000 user 0.130000 sys 0.030000 (best of 56)
after: ! wall 0.123228 comb 0.120000 user 0.120000 sys 0.000000 (best of 68)
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 06:07:33 +0100] rev 40785
mmapindex: move the 'mmapindexthreshold' option out of experimental
The option is useful and should be advertised more. We move it out of
experimental as a first step. The `storage` section is selected as this is
related to how the storage is accessed. A new 'performance' section might be
more appropriate.
We move from 'mmapindexthreshold` to `mmap-threshold` as non-index item are
also suitable for mmap (eg: the rev-branch-cache).
If relevant, we can introduce sub-option `mmap-threshold.revlog-index` later.
Boris Feld <boris.feld@octobus.net> [Sat, 01 Dec 2018 15:57:27 +0100] rev 40784
perf: add a --rev attribute to perfindex
This allow for benchmarking the time necessary to look for other version than
the tip.
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 06:03:38 +0100] rev 40783
perf: update perfindex to be more realistic
The previous code was creating a revlog manually, we now use the actual
`localrepo` method to create it.
We have to jump though extra hops to work around the impact of filecache.
Martin von Zweigbergk <martinvonz@google.com> [Sun, 02 Dec 2018 13:09:46 -0800] rev 40782
match: drop unnecessary wrapping of regex in group
It seems the regexes have been wrapped in an unnamed group since
b6c42714d900 (Add locate command., 2005-07-05). In that commit, the
grouping was needed because there was a "head" ('^') added before the
group and a "tail" (os.sep) added after it. It seems the head was
moved inside the group in
1c0c413cccdd (Get add and locate to use new
repo and dirstate walk code., 2005-07-18) and the tail was moved
inside the group in
89985a1b3427 (Clean up walk and changes code to
use normalised names properly., 2005-07-31), So it seems to me that
we've carried around the unnecessary group for 13 years. This patch
removes it.
Differential Revision: https://phab.mercurial-scm.org/D5352
Martin von Zweigbergk <martinvonz@google.com> [Sun, 02 Dec 2018 13:45:20 -0800] rev 40781
match: use _BASE_SIZE instead of magic value 4
Differential Revision: https://phab.mercurial-scm.org/D5351
Martin von Zweigbergk <martinvonz@google.com> [Sun, 02 Dec 2018 13:44:49 -0800] rev 40780
match: make "groupsize" include the trailing "|"
I think this is a little easier to follow and it will simplify later
patches too.
Differential Revision: https://phab.mercurial-scm.org/D5350
Martin von Zweigbergk <martinvonz@google.com> [Sun, 02 Dec 2018 13:09:43 -0800] rev 40779
match: fix an unaligned (but harmless) indent
Differential Revision: https://phab.mercurial-scm.org/D5349
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 17:41:10 +0100] rev 40778
match: raise an Abort error instead of OverflowError
This case of OverflowError (one single pattern being too large) has never been
properly caught in the past.
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 21:02:02 +0100] rev 40777
match: avoid translating glob to matcher multiple times for large sets
For hgignore with many globs, the resulting regexp might not fit under the 20K
length limit. So the patterns need to be broken up in smaller pieces.
Before this change, the logic was re-starting the full process from scratch
for each smaller pieces, including the translation of globs into regexp.
Effectively doing the work over and over.
If the 20K limit is reached, we are likely in a case where there is many such
glob, so exporting them is especially expensive and we should be careful not
to do that work more than once.
To work around this, we now translate glob to regexp once and for all. Then,
we assemble the resulting individual regexp into valid blocks.
This raises a very significant performance win for large `.hgignore file`:
Before: ! wall 0.153153 comb 0.150000 user 0.150000 sys 0.000000 (median of 66)
After: ! wall 0.059793 comb 0.060000 user 0.060000 sys 0.000000 (median of 100)
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 17:25:49 +0100] rev 40776
match: extract function that group regexps
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 17:16:05 +0100] rev 40775
match: test for overflow error in pattern
If a single pattern is too large to handle, we raise an exception. This case is
now doctested.
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 17:20:32 +0100] rev 40774
match: extract a literal constant into a symbolic one
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 Dec 2018 21:42:48 -0500] rev 40773
tests: apply binary mode to output in seq.py
I noticed this when playing with running tests using WSL, and iterating over the
output yielded '0\r', '1\r',... Most of the other *.py tools do this, and `seq`
on MSYS lacks '\r' in the output, so this is more consistent.
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 01:09:37 +0100] rev 40772
perf: add a `--clear-caches` to `perfbranchmapupdate`
This flag will help to measure the time we spend loading various cache that
support the branchmap update.
Example for an 500 000 revisions repository:
hg perfbranchmapupdate --base 'not tip' --target 'tip'
! wall 0.000860 comb 0.000000 user 0.000000 sys 0.000000 (best of 336)
hg perfbranchmapupdate --base 'not tip' --target 'tip' --clear-caches
! wall 0.029494 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)
Boris Feld <boris.feld@octobus.net> [Wed, 21 Nov 2018 21:11:47 +0000] rev 40771
perf: start from an existing branchmap if possible
If the --base set if a superset of one of the cached branchmap, we should use as
a starting point. This greatly help the overall runtime of
`hg perfbranchmapupdate`
For example, for a repository with about 500 000 revisions, using this trick
make the command runtime move from about 200 second to about 10 seconds. A 20x
gain.
Boris Feld <boris.feld@octobus.net> [Wed, 21 Nov 2018 20:35:22 +0000] rev 40770
perf: rely on repoview for perfbranchmapupdate
Using 'repoview' matching the base and target subset make the benchmark more
realistic. It also unlocks optimization to make the command initialization
faster.
Boris Feld <boris.feld@octobus.net> [Wed, 21 Nov 2018 22:56:06 +0100] rev 40769
perf: pre-indent some code in `perfbranchmapupdate`
This make the next patch easier to read.
Boris Feld <boris.feld@octobus.net> [Wed, 21 Nov 2018 12:02:25 +0000] rev 40768
perf: add a `perfbranchmapupdate` command
This command benchmark the time necessary to update the branchmap between two
sets of revisions. This changeset introduce a first version, doing nothing fancy
regarding cache or other internal details.
Anton Shestakov <av6@dwimlabs.net> [Mon, 05 Nov 2018 13:52:19 +0800] rev 40767
push: config option to control behavior when pushing to a publishing server
Pushing to a publishing server by mistake can lead to a difficult situation to
solve because evolution doesn't work on public changesets. This new
experimental config tries to help avoiding unintentionally (or at least being
aware of) pushing to publishing remotes.
`hg push --publish` can be used to make push succeed even when auto-publish is
set to 'abort'.
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 30 Nov 2018 17:42:55 +0300] rev 40766
narrowcommands: remove an unrequired `repo.narrowpats` call
We call that few lines above and do nothing significant in between which can
change the narrowpats. So let's use values returned by that call.
Differential Revision: https://phab.mercurial-scm.org/D5348
Augie Fackler <augie@google.com> [Thu, 29 Nov 2018 16:44:01 -0500] rev 40765
manifest: reject lines shorter than 42 bytes, not 22
Yuya correctly spotted during the review of
f27f8e9ef1e73 that we're
dealing with hexlified hashes here, and so it should be 42 bytes not
22.
Differential Revision: https://phab.mercurial-scm.org/D5347
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 20:05:38 +0900] rev 40764
blackbox: initialize logger with repo instance
The blackboxlogger is unusable without a repo. Let's simply initialize it
with a repo instance.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Nov 2018 20:56:25 +0900] rev 40763
blackbox: do not nullify repo to deactivate the logger on failure
The _repo will be a mandatory attribute. Instead, make the logger to not
track any events.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 20:02:34 +0900] rev 40762
blackbox: extract global last logger to proxylogger class
So the blackboxlogger can be instantiated with a repo.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 19:36:21 +0900] rev 40761
ui: pass in bytes opts dict to logger.log()
This is the convention of the Mercurial API.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 19:35:33 +0900] rev 40760
ui: pass in formatted message to logger.log()
This makes sure that all logger instances will handle the message arguments
properly.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:34:46 +0900] rev 40759
blackbox: send debug message to logger by core ui
Since the core ui.log() may recurse into ui.log() through ui.debug(), it
must guard against recursion.
The ui extension class can finally be removed.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Nov 2018 20:23:50 +0900] rev 40758
blackbox: change the way of deactivating the logger on write error
This prepares for the upcoming code move. The recursion guard will be ported
to the core ui.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 28 Nov 2018 10:12:50 -0800] rev 40757
match: remove obsolete catching of OverflowError
Since
0f6a1bdf89fb (match: handle large regexes, 2007-08-19), we catch
an OverflowError from the regex engine and split up the regex if that
happens. In
59a9dc9562e2 (ignore: split up huge patterns, 2008-02-11),
that was extended to raise an OverflowError in our code even if the
regex engine doesn't raise it. It's unclear if there was a range of
regex sizes where the OverflowError would be raised from the regex
engine but that were still below the limit we added in our
code. Either way, both limitations were probably removed in Python
2.7.4 when the regex code width was extended from 16bit to 32bit (or
Py_UCS4) integer (thanks to Yuya for finding that out).
If at least the first limitation was removed, we no longer should be
using OverflowError for flow control, so this patch changes that.
Differential Revision: https://phab.mercurial-scm.org/D5309
Boris Feld <boris.feld@octobus.net> [Tue, 27 Nov 2018 02:10:14 +0100] rev 40756
sparse: raise a move verbose index error from the C code
If we don't like a value we should print it.
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 05 Oct 2018 23:10:56 +0300] rev 40755
narrow: drop the bundle2 capability since we have server capabilities (BC)
This patch drops the narrow bundle2 capabilities since we introduced narrow
server capabilities which are more nice and now used everywhere.
I am not sure what it can affect, so on safe side I marked this as BC. Also I
removed the NARROWCAP constant as that kind of conflicts with the same name
constant in wireprototypes.py.
Differential Revision: https://phab.mercurial-scm.org/D4892
Boris Feld <boris.feld@octobus.net> [Sun, 02 Jul 2017 04:06:24 +0200] rev 40754
vfs: extract the audit path logic into a submethod
This will make it possible to apply it in more cases.
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 20:01:28 +0100] rev 40753
subrepo-git: use an official origvfs when appropriate
The origvfs has the auditor properly set and can move file without issue.
The current code is currently working without errors because rename are not
audited, yet.
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 19:26:05 +0100] rev 40752
revert: extract origvfs logic in a sub-function
The subrepo's "revert" logic could benefit from it.
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 18:44:07 +0100] rev 40751
vfs: treat 'undo.' file the same as 'journal.' file
They are the same kind of file, they are protected by the store lock, but
directly lives inside the '.hg' directory.
No warnings were ever raised about them because `vfs.rename` is not audited.
Something we are trying to change.
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 21:00:13 +0100] rev 40750
perf: add a perfignore command
The command is meant to benchmark operations related to hgignore. Right now the
command is benchmarking the loading time of the hgignore rules.
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 26 Nov 2018 15:36:06 +0300] rev 40749
py3: use pycompat.xrange instead of xrange
xrange does not exists on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5302
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 27 Nov 2018 16:16:13 +0300] rev 40748
store: write fncache only once if there are both adds and removes
Differential Revision: https://phab.mercurial-scm.org/D5307
Boris Feld <boris.feld@octobus.net> [Tue, 20 Nov 2018 17:44:24 +0000] rev 40747
perf: disable revlogs clearing in `perftags` by default
This aligns things with what `perfbookmarks` does. I decided to disable the
revlogs clearing by default to focus on the core logic by default, ignoring
side effects.
If we prefer to emphasize the side effect, we can instead keep this on in
`perftags` and enable it by default in `perfbookmarks`.
Boris Feld <boris.feld@octobus.net> [Tue, 20 Nov 2018 10:55:20 +0000] rev 40746
perf: add a `clear-revlogs` flag to `perfbookmarks`
This flag (off by default) makes it possible to enable the refresh of the
changelog and revlog. This is useful to check for costly side effects of
bookmark loading.
Usually, these side effects are shared with other logics (eg: tags).
example output in my mercurial repo (with 1 bookmark, so not a great example):
$ hg perfbookmarks
! wall 0.000044
$ hg perfbookmarks --clear-revlogs
! wall 0.001380
Boris Feld <boris.feld@octobus.net> [Tue, 20 Nov 2018 10:38:15 +0000] rev 40745
tags: cache `repo.changelog` access when checking tags nodes
The tags reading process checks if the nodes referenced in tags exist. Caching
the access to `repo.changelog` provides a large speedup for repositories with
many tags.
running `hg perftags` in a large private repository
before: ! wall 0.393464 comb 0.390000 user 0.330000 sys 0.060000 (median of 25)
after: ! wall 0.267711 comb 0.270000 user 0.210000 sys 0.060000 (median of 38)
Boris Feld <boris.feld@octobus.net> [Tue, 20 Nov 2018 10:46:20 +0000] rev 40744
perf: add a `clear-revlogs` flag to `perftags`
This flag (on by default) makes it possible to disable the refresh of the
changelog and revlog. This is useful to check for the time spent in the core
tags logic without the associated side effects. Usually, these side effects
are shared with other logics (eg: bookmarks).
Example output in my Mercurial repository
$ hg perftags
! wall 0.017919 comb 0.020000 user 0.020000 sys 0.000000 (best of 141)
$ hg perftags --no-clear-revlogs
! wall 0.012982 comb 0.010000 user 0.010000 sys 0.000000 (best of 207)
Boris Feld <boris.feld@octobus.net> [Sun, 25 Nov 2018 13:37:53 +0100] rev 40743
perf: stop creating new revlog by hand in perftags
It's better to let the repository logic create its own object. We now just clear
the cache. New object will be automatically created from there.
Boris Feld <boris.feld@octobus.net> [Mon, 26 Nov 2018 00:23:12 +0100] rev 40742
revlog: update the documentation for `trim_endidx`
The function role drifted since the function was commented.
Boris Feld <boris.feld@octobus.net> [Mon, 26 Nov 2018 00:21:09 +0100] rev 40741
revlog: properly detect corrupted revlog in `index_get_length`
Pointed out by Yuya Nishihara.
Boris Feld <boris.feld@octobus.net> [Mon, 26 Nov 2018 00:15:12 +0100] rev 40740
perf: rename `perfhelper-tracecopies` to `perfhelper-pathcopies`
The command it supports is called `perfpathcopies`. It seems better to align the
names.
Boris Feld <boris.feld@octobus.net> [Mon, 26 Nov 2018 00:13:50 +0100] rev 40739
perf: add a docstring to `perfpathcopies`
This will help people to find this command.
Boris Feld <boris.feld@octobus.net> [Mon, 26 Nov 2018 00:08:11 +0100] rev 40738
revlog: update the docstring of `ancestors` to match reality
Code using this method expect the revision to be (reverse) sorted. As pointed by
Yuya Nishihara, the docstring should reflect that.
Augie Fackler <augie@google.com> [Mon, 26 Nov 2018 15:53:34 -0500] rev 40737
remotefilelog: fix typo in docstring
Differential Revision: https://phab.mercurial-scm.org/D5306
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 23 Nov 2018 18:58:16 +0300] rev 40736
store: append to fncache if there are only new files to write
Before this patch, if we have to add a new entry to fncache, we write the whole
fncache again which slows things down on large fncache which have millions of
entries. Addition of a new entry is common operation while pulling new files or
commiting a new file.
This patch adds a new fncache.addls set which keeps track of the additions
happening and store them. When we write the fncache, we will just read the addls
set and append those entries at the end of fncache.
We make sure that the entries are new entries by loading the fncache and making
sure entry does not exists there. In future if we can check if an entry is new
without loading the fncache, that will speed up things more.
Performance numbers for commiting a new file:
mercurial repo
before: 0.
08784651756286621
after: 0.
08474504947662354
mozilla-central
before: 1.
83314049243927
after: 1.
7054164409637451
netbeans
before: 0.
7953150272369385
after: 0.
7202838659286499
pypy
before: 0.
17805707454681396
after: 0.
13431048393249512
In our internal repo, the performance improvement is in seconds.
I have used octobus's ASV perf benchmark thing to get the above numbers. I also
see some minute perf improvements related to creating a new commit without a new
file, but I believe that's just some noise.
Differential Revision: https://phab.mercurial-scm.org/D5301
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 26 Nov 2018 15:38:35 +0300] rev 40735
py3: fix couple of division operator to do integer divison
Differential Revision: https://phab.mercurial-scm.org/D5305
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 26 Nov 2018 15:37:48 +0300] rev 40734
py3: use dict.items() instead of dict.iteritems()
dict.iteritems() does not exist on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5304
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 26 Nov 2018 15:36:51 +0300] rev 40733
py3: convert strings to bytes in tests/test-remotefilelog-histpack.py
Differential Revision: https://phab.mercurial-scm.org/D5303
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 23 Nov 2018 21:54:03 +0300] rev 40732
py3: replace str() with pycompat.bytestr() or ('%d' % int)
After this patch, test-fastannotate-diffopts.t is about to pass. There are some
extra newlines in the output.
Differential Revision: https://phab.mercurial-scm.org/D5300
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 19:32:51 +0100] rev 40731
perf: add a `--timing` argument to `perfhelper-tracecopies`
The new argument will help picking better pair for benchmarking. See
documentation for details.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 18:08:33 +0900] rev 40730
ui: manage logger instances and event filtering by core ui
The setup code in blackbox needs more tweaks since it has lots of black
magics. I'll fix them by follow-up patches.
To be clear, the goal of this series is to provide a proper way for command
server to install its own logger. I need it to debug in-memory repository
cache.
Yuya Nishihara <yuya@tcha.org> [Mon, 12 Nov 2018 21:10:51 +0900] rev 40729
extensions: add "uipopulate" hook, called per instance, not per process
In short, this is the "reposetup" function for ui. It allows us to modify
ui attributes without extending ui.__class__. Before, the only way to do
that was to abuse the config dictionary, which is copied across ui instances.
See the next patch for usage example.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Nov 2018 19:11:45 +0900] rev 40728
hgweb: load globally-enabled extensions explicitly
Before, extensions were loaded as a side effect of hg.repository() if the
hgweb was executed as a CGI/WSGI. I want to make it explicit so that another
ui hook can be inserted after extensions.loadall().
Augie Fackler <augie@google.com> [Wed, 14 Nov 2018 10:12:43 -0500] rev 40727
tests: sniff for libfuzzer actually being available in test-fuzz-targets.t
When I upgraded the FreeBSD buildbot to 11.2 it seems we picked up
clang6, but the default clang on FreeBSD doesn't include libfuzzer. I
can't find a way to sniff for libfuzzer without running a compile, so
here we are.
Differential Revision: https://phab.mercurial-scm.org/D5270
Augie Fackler <augie@google.com> [Wed, 14 Nov 2018 10:11:37 -0500] rev 40726
tests: sniff for /usr/local/bin/gmake and use it in test-fuzz-targets.t
This isn't as robust as it probably should be, but for now it'll get
the job done on the buildbots.
Differential Revision: https://phab.mercurial-scm.org/D5269
Augie Fackler <augie@google.com> [Thu, 29 Nov 2018 16:25:37 -0500] rev 40725
tests: stabilize test-inherit-mode.t on FreeBSD and macOS (
issue6026)
Symbolic links are funny permissions-wise, but on the linked issue
Yuya has convinced me that we can ignore this permissions issue on
macOS (FreeBSD allows setting permissions bits but ignores them) and
we'll be in fine shape.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Nov 2018 12:52:23 -0800] rev 40724
wireprotov2peer: wait for initial object before resolving future
As part of rolling out wireprotov2 with redirect support, I
encountered an edge case with regards to future resolution.
Essentially, the initial response frame from the server did not
fully decode the initial CBOR object. The frame wasn't marked as
EOS. In the previous code, we resolved the future for the request
to response.objects(), which mapped to the commandresponse instance
which would eventually produce a redirect. Upon receiving
subsequent data, the initial CBOR object containing the redirect
would be decoded and we'd process the redirect. However, the
future would already have been resolved with the initial
commandresponse.objects() and the client iterating over the
objects wouldn't receive any objects from the redirect because
the redirect was populating a different commandresponse instance!
This commit changes the logic so we don't resolve futures until
the initial CBOR response object is fully decoded or until EOS
occurs. In cases where there is an empty or partial frame
associated with a redirect, the future will now resolve with the
commandresponse containing the proper series of decoded objects.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Nov 2018 10:37:43 -0800] rev 40723
wireprotov2peer: always return a bool from _processredirect()
Without this, we may stop servicing the redirect response if the
future has already been resolved. And the future will often be
resolved very early, since many consumers iterate the decoded
CBOR object stream and expect data to lazily arrive.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 24 Nov 2018 14:11:02 -0500] rev 40722
tests: disable remotefilelog on Windows
I've spent a non trivial amount of time trying to eliminate the test errors, but
it's looking like this is pretty dependent on Unix support. For example, there
are attempts to delete open files, and uses of threads that report I/O attempts
on closed files. (Maybe this is a race condition? Don't we usually use
processes as workers on Windows?)
In any event, I don't want real new errors elsewhere to be masked by these known
problems.
For some reason $CACHEDIR is reported as missing in test-remotefilelog-repack.t,
but it actually exists in the hgcloneshallow call inside
shallowutil.mkstickygroupdir(). By the time the process exits, it's gone. I
don't see it being removed by code that calls 'rmdir' or 'remove' in the
extension itself.
Boris Feld <boris.feld@octobus.net> [Thu, 22 Nov 2018 23:48:44 +0100] rev 40721
perf: run 'setup' function during stub run
The benchmarked function might need the content of the setup to be run in order
to function properly.
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 02:08:01 +0100] rev 40720
perf: fallback to subset if ondisk cache is missing in perfbranchmapload
If there is no branchmap on disk for that filter, it means that the cache from
some subset's filter is relevant for this one. We look for it instead of
aborting.
That way it is much simpler to run the command in an automated way. We can now
add it to `test-contrib-perf.t`.
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 02:11:11 +0100] rev 40719
perf: prewarm the branchmap in perfbranchmapload
It is not very interesting to have the command randomly failing because the
branchmap for the tested filter happens to be cold. So we make sure to have a
valid up to date branchmap before going further.
The data might still be missing from disk if a subset was equivalent. See next
changeset for details and fix.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Nov 2018 22:39:54 +0900] rev 40718
localrepo: correct docstring of filectx()
The same reason as
b6c2543e1dd8. It can't be any changeset specifiers but
revision number.
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Nov 2018 20:05:55 +0900] rev 40717
annotate: remove dead code to not convert path to relative path
It's annotate. There should be at least one file path specified.
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Nov 2018 18:41:44 +0900] rev 40716
annotate: start pager soon after command options are validated
It helps extracting helper class.
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Nov 2018 18:38:44 +0900] rev 40715
annotate: check and update command options first
It helps extracting helper class.
Yuya Nishihara <yuya@tcha.org> [Sat, 24 Nov 2018 18:36:44 +0900] rev 40714
annotate: format local tables in less-dense form
I'll move these to a class, where one-extra indent will be needed.
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 22 Nov 2018 18:14:21 +0300] rev 40713
perf: rename version flag of perfchangegroupchangelog to cgversion
The version flag conflicts with the global version flag and does not work.
Differential Revision: https://phab.mercurial-scm.org/D5297
Differential Revision: https://phab.mercurial-scm.org/D5298
Matt Harbison <matt_harbison@yahoo.com> [Fri, 23 Nov 2018 22:27:57 -0500] rev 40712
procutil: don't allow the main 'hg' script to be treated as the Windows exe
Previously, there were a handful of errors like this:
$ hg prefetch --repack
(running background incremental repack)
+ abort: %1 is not a valid Win32 application
+ [255]
CreateProcess() doesn't append .exe when `lpApplicationName` contains a path,
and a python script isn't directly executable.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 23 Nov 2018 22:18:56 -0500] rev 40711
remotefilelog: drop some compatibility cruft for finding the hg exeutable
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 21 Nov 2018 17:17:26 +0300] rev 40710
branchmap: build the revbranchcache._namesreverse() only when required
On big repositories with a lot of named branches and that also increasing over
time, building of this dict can be expensive and shows up in profile.
For our internal repository, this saves ~0.05 seconds.
Thanks to Yuya for suggesting using util.propertycache() and
util.clearcachedproperty().
Differential Revision: https://phab.mercurial-scm.org/D5291
Boris Feld <boris.feld@octobus.net> [Thu, 15 Nov 2018 11:11:38 +0100] rev 40709
sparse-revlog: put the native implementation of slicechunktodensity to use
When possible, the C implementation of delta chain slicing will be used.
providing a large boost in performance for this operation.
To take a practical example of restoring manifest revision '
59547c40bc4c' for
a reference NetBeans repository (using sparse-revlog). The media time of the
step `slice-sparse-chain` of `perfrevlogrevision` improve from 0.660 ms to
0.098 ms;
The full series move delta chain slicing from 1.120 ms to 0.098 ms;
Implementing _slicechunktosize into C would yield further improvements.
However, the performance seems good enough for now.
Boris Feld <boris.feld@octobus.net> [Thu, 15 Nov 2018 11:10:52 +0100] rev 40708
cext: increment the `parsers` module version
We introduced a new `slicechunktodensity` method to the index.
Boris Feld <boris.feld@octobus.net> [Thu, 15 Nov 2018 11:09:58 +0100] rev 40707
sparse-revlog: introduce native (C) implementation of slicechunktodensity
This is a C implementation of `_slicechunktodensity` in the
`mercurial/revlogutils/deltas.py` file.
The algorithm involves a lot of integer manipulation and low-level access to
index data. Having a C implementation of it raises a large performance
improvement. See later changeset in this series for details.
Boris Feld <boris.feld@octobus.net> [Fri, 09 Nov 2018 18:45:23 +0100] rev 40706
sparse-revlog: add a `trim_endidx` function in C
We are about to implement a native version of `slicechunktodensity`. For
clarity, we introduce the helper functions first.
This function implement a subpart of the python function `_trimchunk` in
`mercurial/revlogutils/deltas.py`. Handling of actual Python objects is left
to the caller function.
Boris Feld <boris.feld@octobus.net> [Fri, 09 Nov 2018 18:43:16 +0100] rev 40705
sparse-revlog: add a `index_segment_span` function in C
We are about to implement a native version of `slicechunktodensity`. For
clarity, we introduce the helper functions first. This new function provides
an efficient way to retrieve some of the information needed by
`slicechunktodensity`.
Boris Feld <boris.feld@octobus.net> [Fri, 09 Nov 2018 18:42:58 +0100] rev 40704
sparse-revlog: add a `index_get_length` function in C
We are about to implement a native version of `slicechunktodensity`. For
clarity, we introduce the helper functions first. This new function provides
an efficient way to retrieve some of the information needed by
`slicechunktodensity`.
Boris Feld <boris.feld@octobus.net> [Tue, 20 Nov 2018 14:49:18 +0000] rev 40703
sparse-revlog: add a `index_get_start` function in C
We are about to implement a native version of `slicechunktodensity`. For
clarity, we introduce the helper functions first. This new function provides
an efficient way to retrieve some of the information needed by
`slicechunktodensity`.
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 06:32:32 +0100] rev 40702
perf: add --clear-revlog flag to branchmapload
Having the changelog index already loaded when loading the branchmap can have a
large impact on performance.
Example runs (large private repository):
hg perfbranchmapload -f base
! wall 0.116722 comb 0.120000 user 0.110000 sys 0.010000 (best of 59)
hg perfbranchmapload -f base --clear-revlogs
! wall 0.258246 comb 0.230000 user 0.220000 sys 0.010000 (best of 31)
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 06:32:28 +0100] rev 40701
perf: introduce a function to fully "unload" a changelog
The function remove various attributes and caches related to changelog.
This is getting a common requirement.
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 01:32:57 +0100] rev 40700
perf: use an explicit function in perfbranchmapload
This make things clearer.
Boris Feld <boris.feld@octobus.net> [Fri, 23 Nov 2018 01:20:18 +0100] rev 40699
perf: update function name to match `perfbranchmapload` command
Having function with the same name as the command is simpler.
Boris Feld <boris.feld@octobus.net> [Wed, 21 Nov 2018 11:46:47 +0000] rev 40698
perf: fix a minor typo in perfbranchmapload
Boris Feld <boris.feld@octobus.net> [Wed, 10 Oct 2018 00:50:37 +0200] rev 40697
context: floor adjustlinkrev graph walk during copy tracing
The `_adjustlinkrev` method gains an optional "stoprev" argument. The linkrev
adjustment will give up once this floor is reached. The relevant functions
using `_adjustlinkrev` are updated to pass an appropriate value in the copy
tracing code.
In some private repository, about 10% of the status call triggered the
pathological case addressed by this change. The speedup varies from one call
to another, the best-observed win is moving from 170s to 11s.
The effect of this change can be seen in the public pypy repository, running the
following command:
hg perftracecopies --source
83c9ff0c0206 --destination
59c79103d5b0
before: 3.401753 seconds
after: 2.634897 seconds (-23%)
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 14:30:58 +0000] rev 40696
context: small refactoring of `isintroducedafter`
This make the next change clearer.
Boris Feld <boris.feld@octobus.net> [Wed, 10 Oct 2018 00:50:36 +0200] rev 40695
context: split `introrev` logic in a sub function
We want to add a mechanism to stop iteration early associated to intro rev early
in some case. However, it does not make sense to expose it in the public
`filectx` API. So we split the code into an internal method instead.
Boris Feld <boris.feld@octobus.net> [Wed, 10 Oct 2018 00:50:35 +0200] rev 40694
context: introduce an `isintroducedafter` method and use it in copies
Right now, copy tracing make effort to not traverse the graph too much to save
performance. It uses a "limit" acting as a floor revision past which data are
no longer relevant to the current copy tracing.
However, to enforce this limit, it does a call to `filectx.rev()` and that
call can trigger a graph traversal on its own. That extra graph traversal is
unaware of the current limit and can become very expensive. That cost is
increased by the nature of work done in adjust link rev, we are not only
walking down the graph, we are also checking the affected file for each
revision we walk through. Something significantly more expensive than the walk
itself.
To work around this we need to make the `filectx` operation aware of the
current limit. The first step is to introduce a dedicated method:
`isintroducedafter`. We'll then rework that method logic to stop traversal as
soon as possible.
Boris Feld <boris.feld@octobus.net> [Wed, 10 Oct 2018 00:50:34 +0200] rev 40693
context: take advantage of `_descendantrev` in introrev if available
Before this changeset, `_descendantrev` was ignored and `introrev` could
return a "wrong" result. I was previously fine because there seems to be no
existing code using both `introrev` and `_descendantrev` at the same time.
However, we would like to change that.
Boris Feld <boris.feld@octobus.net> [Wed, 10 Oct 2018 00:49:30 +0200] rev 40692
context: spell out the logic around linkrev adjustement starting point
We make the intent of the `_changeid` and `_changectx` checks explicit. The
same logic was previously performed by the `self.rev()` call. The new code is
a bit redundant, but much clearer.
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 14:14:56 +0000] rev 40691
perf: add a new `perfhelper-tracecopies` command
The command is not measuring performance itself, it digs interesting statistic
to help pick good arguments for the `perfcopytrace` command.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 21 Sep 2018 09:19:42 -0700] rev 40690
narrow: extract helper for parsing narrowspec file
This will be used for parsing a file that's stored in a different
location.
Differential Revision: https://phab.mercurial-scm.org/D5277
Yuya Nishihara <yuya@tcha.org> [Thu, 22 Nov 2018 22:40:22 +0900] rev 40689
py3: cast attribute name to sysstr in clearcachedproperty()
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 21 Nov 2018 19:12:12 +0300] rev 40688
py3: whitelist three more passing test caught by buildbot
The number of failing test is back to two digits.
Differential Revision: https://phab.mercurial-scm.org/D5293
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Wed, 21 Nov 2018 13:08:23 -0500] rev 40687
tests: make test-check-module-imports more robust
It failed for me without this in this way:
tests/test-commandserver.t:19: relative import of stdlib module
tests/test-lfs-serve.t:108: relative import of stdlib module
tests/test-lfs-serve.t:255: relative import of stdlib module
tests/test-lfs-serve.t:362: relative import of stdlib module
tests/test-lfs-serve.t:406: relative import of stdlib module
tests/test-lock.py:9: imports not lexically sorted: silenttestrunner < unittest, True, True
tests/test-lrucachedict.py:5: imports not lexically sorted: silenttestrunner < unittest, True, True
tests/test-match.py:5: imports not lexically sorted: silenttestrunner < unittest, True, True
tests/test-remotefilelog-datapack.py:15: imports not lexically sorted: silenttestrunner < unittest, True, True
tests/test-remotefilelog-histpack.py:14: imports not lexically sorted: silenttestrunner < unittest, True, True
tests/test-simplekeyvaluefile.py:4: imports not lexically sorted: silenttestrunner < unittest, True, True
tests/test-sshserver.py:6: imports not lexically sorted: silenttestrunner < unittest, True, True
This is because every module is considered a stdlib module, because
the stdlib_prefixes is /usr, and my repo is in /usr/local/home, which
means that sys.path contains a couple of
/usr/local/home/../hg/.. entries that count as "in the stdlib".
Fix this by preventing any path in sys.path that's inside the mercurial
source from being considered "in the stdlib".
Differential Revision: https://phab.mercurial-scm.org/D5294
Anton Shestakov <av6@dwimlabs.net> [Sat, 27 Oct 2018 21:13:23 +0800] rev 40686
push: add --publish flag to change phase of pushed changesets
This flag is copied from topic extension, where it proved to be useful. It
makes all pushed changesets public on both ends if the push succeeds.
Doesn't currently work for any subrepos that are implicitly pushed together
with their owner repo.
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 17:19:54 +0000] rev 40685
match: reformat `syntaxes` dictionary for better maintainability
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 18:54:44 +0000] rev 40684
match: provide and use a quick way to escape a single byte
The previous function has a lot of overhead (including being a function). In
the `_globre` case, we always escape a single byte. So we provide a dictionary
dedicated to this use case. We directly use the dictionary to avoid a function
call, these are expensive in Python.
Again, this raise a very significant performance gain:
Before: ! wall 0.059793 comb 0.060000 user 0.060000 sys 0.000000 (median of 100)
After: ! wall 0.020390 comb 0.020000 user 0.020000 sys 0.000000 (median of 146)
Total improvement for the full series:
Before: ! wall 0.153153 comb 0.150000 user 0.150000 sys 0.000000 (median of 66)
After: ! wall 0.020390 comb 0.020000 user 0.020000 sys 0.000000 (median of 146)
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 16:50:21 +0000] rev 40683
perf: make `clearfilecache` helper work with any object
If the object is not a localrepo, it won't have an `unfiltered` method (and
won't need one).
Boris Feld <boris.feld@octobus.net> [Tue, 20 Nov 2018 10:10:25 +0000] rev 40682
perf: move some of the perftags benchmark to the setup function
Creating fresh objects and clearing the cache should not be part of the
timing.
before: ! wall 0.020851 comb 0.020000 user 0.020000 sys 0.000000 (median of 138)
after: ! wall 0.018740 comb 0.020000 user 0.020000 sys 0.000000 (median of 141)
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 23:14:46 +0000] rev 40681
perf: use the new setup function in "perfbookmarks"
This command was picked arbitrarily to display the usefulness of the new
feature. In my Mercurial repository (with very few bookmarks), moving cache
cleanup in the dedicated setup function has a visible and stable effect on
the benchmark number.
before: ! wall 0.000061 comb 0.000000 user 0.000000 sys 0.000000 (median of 40837)
after: ! wall 0.000058 comb 0.000000 user 0.000000 sys 0.000000 (median of 40500)
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 22:55:07 +0000] rev 40680
perf: add a `setup` argument to run code outside of the timed section
With this new argument, it is possible to perform special setup and cleanup
outside of code actually timed. This is useful to provide more accurate
benchmark.
Boris Feld <boris.feld@octobus.net> [Mon, 19 Nov 2018 23:02:29 +0000] rev 40679
perf: explicitly pass title as a keyword argument in `perfdiffwd`
This will help to update the timer function arguments in a later changeset.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:59:23 +0900] rev 40678
ui: unify argument name of ui.log()
It's called an "event" in both blackbox and logtoprocess.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:45:18 +0900] rev 40677
logtoprocess: extract logger class from ui wrapper
It provides the same interface as the blackboxlogger. The ui wrapper will
be removed shortly.
Yuya Nishihara <yuya@tcha.org> [Wed, 21 Nov 2018 21:40:16 +0900] rev 40676
merge with stable
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 19 Nov 2018 21:12:13 +0300] rev 40675
py3: use node.hex(m.digest()) instead of m.hexdigest()
hashlib.sha1.hexdigest() returns str on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5287
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Nov 2018 18:47:19 -0500] rev 40674
tests: stabilize the recent checkexec changes on Windows
This goes with
bd0874977a5e.
Boris Feld <boris.feld@octobus.net> [Sun, 18 Nov 2018 02:40:47 +0100] rev 40673
tests: add Balto configuration file
I have been developing a Mercurial test runner plugin for being able to run
Mercurial tests with Balto
(https://bitbucket.org/lothiraldan/balto/src/default/).
Balto requires a configuration file so let's include it, I have added the
required information in the configuration file as comments.
I hope Balto would be an helpful tool for other people than me.
Differential Revision: https://phab.mercurial-scm.org/D5283
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Mon, 19 Nov 2018 13:40:03 -0500] rev 40672
tests: make test-alias.t pass with re2
Locally, these "non-ASCII character in alias" errors don't show up,
though I get them when the alias is defined at the command line rather
than in an hgrc.
The brokenness comes from the fact that hgrcs are parsed with regexes,
and re/re2 differ in this way:
$ python -c 'import re; print(re.compile("(.*)").match("aaa\xc0bbbb").groups())'
('aaa\xc0bbbb',)
$ python -c 'import re2; print(re2.compile("(.*)").match("aaa\xc0bbbb").groups())'
('aaa',)
Apparently re2 stops when it encounters invalid utf8 (which I suppose makes sense
given that '.' matches what appears to be a codepoint rather than a byte). This is
presumably a bug in hg, but not very important, so just change the test to stick
to valid utf8.
Differential Revision: https://phab.mercurial-scm.org/D5288
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Nov 2018 23:08:09 -0800] rev 40671
context: remove seemingly impossible code branch
I'm not a Python expert, but I can't think of a way that the following
branch can ever be hit:
def _changeid(self):
if r'_changeid' in self.__dict__:
return self._changeid
It seems to me that if that condition is true, then this function
would not have been called. The only exception I can think of is if a
reference to the function had been stored beforehand, something like this:
c = fctx.__dict__['_changeid']
fctx._changeid
c()
But that seems like very unlikely code to exist.
The condition was added in
921b64e1f7b9 (filecontext: use 'is not
None' to check for filelog existence, 2013-05-01) as a "bonus" change
(in addition to what the patch was actually about)
Differential Revision: https://phab.mercurial-scm.org/D5289
Boris Feld <boris.feld@octobus.net> [Thu, 15 Nov 2018 03:09:23 +0100] rev 40670
checkexec: create destination directory if necessary
Since
460733327640, a "share" use the cache of the source repository. A side
effect is that no `.hg/cache` directory exists in the "share" anymore. As a
result, the checkexec logic can't use it to create its temporary file and have
to use the working copy for that.
This is suboptimal, it pollutes the working copy and prevents them to keep the
file around in cache. We do not want to use the cache directory for the share
target, it might be on a different file system.
So instead, we (try to) create the directory if it is missing. This is a
simple change that fixes the current behavior regression on stable.
On default, we should probably ensure the proper directories are created when
initializing the repository. We should also introduce a 'wcache' directory to
hold cache file related to the working copy. This would clarify the cache
situation regarding shares.
The tests catch a couple of other affected cases.
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 19 Nov 2018 21:11:08 +0300] rev 40669
py3: use pycompat.byteskwargs() to covert keys of kwargs to bytes
Differential Revision: https://phab.mercurial-scm.org/D5286
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 19 Nov 2018 20:30:07 +0300] rev 40668
py3: use '%d' for integers instead of '%s'
Differential Revision: https://phab.mercurial-scm.org/D5285
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 19 Nov 2018 19:57:11 +0300] rev 40667
py3: add 9 new passing tests caught by buildbot
Differential Revision: https://phab.mercurial-scm.org/D5284
Anton Shestakov <av6@dwimlabs.net> [Fri, 09 Nov 2018 13:57:13 +0800] rev 40666
branch: allow changing branch of merge commits with --rev
Tests show that changing branch of merge commits works fine with evolution and
without, so let's allow it. Other safeguards should prevent users from shooting
themselves in the foot.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 22:28:38 -0500] rev 40665
lfs: ensure that the return of urlopener.open() is closed
No problem observed, just an oversight noticed while reading documentation.
Kyle Lippincott <spectral@google.com> [Thu, 15 Nov 2018 11:16:42 -0800] rev 40664
changegroup: avoid instantiating storage if we are not using it
Differential Revision: https://phab.mercurial-scm.org/D5280
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Nov 2018 17:56:36 -0500] rev 40663
http: allow 'auth.prefix' to have a username consistent with the URI
It may be a little weird to put a username in the prefix, but the documentation
doesn't disallow it, and silently disallowing it has caused confusion[1]. The
username must match what is passed in (which seems to be from the URI via a
circuitous route), as well as 'auth.username' if it was specified. I thought
about printing a warning for a mismatch, but we already don't print a warning if
the 'auth.username' and URI username don't match.
This change allows the first and second last new test cases to work as expected.
It looks like this would have been a problem since at least
0593e8f81c71.
[1] https://www.mercurial-scm.org/pipermail/mercurial/2018-November/051069.html
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 18:14:57 -0500] rev 40662
lfs: make the exception messages consistent
I don't love that it repeats 'HTTP Error' in an already long message, but I
doubt that we should assume that it will always say that on the original
exception message.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 18:08:29 -0500] rev 40661
lfs: handle URLErrors to add additional information
Sometimes the blob server is hit first (e.g. on push), and sometimes it's hit
last (e.g. pull). Throw in depth first subrepo operations, and things quickly
get insane. It wasn't even mentioning LFS, so just saying "connection refused"
can be confusing- especially if the blob server is a secondary server and
connecting to the repo server works.
The exception handler for the transfer handler will print the full path to the
blob, but that seems fine given that it might be necessary to debug a second
server. (We don't yet support a standalone blob server, so the handler for the
Batch API will cover 99.9% of the current problems. But it might as well be
handled now while I'm thinking about it.)
The function for translating to a message was mostly borrowed from
scmutil.catchall().
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 17:58:59 -0500] rev 40660
lfs: improve the hints for common errors in the Batch API
The previous message was too debug-ish and less action oriented than a hint
should be. The remaining errors that aren't handled are more along the lines of
programming errors (not using POST, bad accept type, etc), so I'm not bothering
with that.
The friendly errors purposely use `self.baseurl` instead of the full Batch API
endpoint because I'd expect some copy/paste/modify on the part of the user here,
and it would be more confusing if '/objects/batch' magically appeared, but
shouldn't be used in the config setting. It still seems like the right thing
for debugging in the catchall case.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 17:55:01 -0500] rev 40659
lfs: provide more Batch API error info via a hint in the raised exception
A coworker had a typo in `lfs.url`, forgot it was even set because usually the
blob server is inferred, and then got a 404. It would have been easier to debug
with the failing URL printed.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 17:50:14 -0500] rev 40658
scmutil: display the optional hint when handling StorageError in catchall()
Other than CensoredNodeError (which is also a StorageError), it looks like all
exceptions with a hint display them. I'm not sure that it makes sense to have a
hint for censored nodes, so I'm not bothering with that.
It looks like nobody is using this yet, as the tests don't change.
Boris Feld <boris.feld@octobus.net> [Thu, 15 Nov 2018 14:57:26 +0100] rev 40657
sparse-revlog: align endrevidx usages in the _slicechunktosize
All "startrevidx..endrevidx" ranges in this function are now half-open.
Yuya Nishihara <yuya@tcha.org> [Thu, 15 Nov 2018 22:59:38 +0900] rev 40656
graft: do not try to skip rev derived from ancestor more than once (
issue6024)
We check 'x in revs' in other cases, so let's do the same.
The test case credits to Tom Prince.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 16 Nov 2018 18:37:26 -0500] rev 40655
subrepo: print the status line before creating the peer for better diagnostics
I ran into a problem where I tried updating to a different branch, and the
process appeared to hang. It turned out that the subrepo revision wasn't
available locally, and I must have originally cloned it from an `hg serve -S` on
a machine that currently wasn't serving anything. It took 2+ minutes to
timeout, and didn't mention what it was connecting to even then.
There are a couple of other issues in this scenario too.
- The repo is dirty after the failed checkout because the top level repo is
updated first. We should probably make 2 passes- top down to pull
everything needed, and then do an update once everything is in place.
- Something must be reading .hgsubstate from wdir because if the same merge
command is run after the timeout, a prompt is issued that the local and
remote subrepo diverged, instead of hanging. But it lists the local version
and remote version as having the same hash.
Boris Feld <boris.feld@octobus.net> [Thu, 15 Nov 2018 14:55:11 +0100] rev 40654
sparse-revlog: use `span` variable as intended
The variable was planned to be used in the while condition but was not used
yet.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 17:38:51 -0500] rev 40653
tests: stabilize test-commandserver.t on Windows
It looks like new test coverage in
054d0fcba2c4, rather than a code change.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 15 Nov 2018 17:36:15 -0500] rev 40652
histedit: conditionalize the imports of 'fcntl' and 'termios'
The recent import of chistedit in
c36175456350 made Windows sad. I'm not sure
if there's other stuff that needs to be done here (e.g. change the default
interface), but this makes the tests run again.
It would have been nicer if the error message indicated these modules were the
problem, but instead it said "*** failed to import extension histedit: No module
named histedit". I'm not sure if there's anything we can do about that.
Boris Feld <boris.feld@octobus.net> [Fri, 16 Nov 2018 14:21:47 +0100] rev 40651
logtoprocess: update commandfinish options arguments
d2c997b8001f changed the logtoprocess API with the effect of not exposing the
positional arguments to the logtoprocess scripts anymore.
We have some scripts that use the duration and return code of the
"commandfinish" event to monitor hg calls. Update the logging of the
"commandfinish" to expose those values as options argument, which will be
accessible as `OPT_RETURN_CODE` and `OPT_DURATION` in logtoprocess arguments.
The code has been formatted with Black.
Differential Revision: https://phab.mercurial-scm.org/D5282
Kyle Lippincott <spectral@google.com> [Thu, 15 Nov 2018 13:16:46 -0800] rev 40650
rebase: fix two ui.logs to actually have text when using default blackbox log
Some implementations of ui.log record structured information along with the
ui.log which can be used for metrics, but ui.log() as implemented by the
blackbox logging does not do anything special with this, and we end up with a
log line with no text (not even a line break) so it ends up looking something
like:
date time user @node (pid) [rebase]> date time user @node (pid) ...
Differential Revision: https://phab.mercurial-scm.org/D5279
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Nov 2018 11:22:32 -0800] rev 40649
wireprotov2server: let repo.narrowmatch(match) do matcher intersection
This is supported since
4fd0fac48922 (localrepo: allow narrowmatch()
to accept matcher to intersect with, 2018-09-28).
Differential Revision: https://phab.mercurial-scm.org/D5281
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:29:46 +0900] rev 40648
blackbox: extract function to test if log event is tracked
This will be a required method of the logger interface.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:25:34 +0900] rev 40647
blackbox: initialize inlog flag properly
And ditch the "bb" prefix as it's no longer a ui extension class.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:24:28 +0900] rev 40646
blackbox: initialize repo attribute properly
And ditch the "bb" prefix as it's no longer a ui extension class.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:22:14 +0900] rev 40645
blackbox: unindent "if True" block
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 17:17:49 +0900] rev 40644
blackbox: extract logger class from ui wrapper
This moves most functions to new blackboxlogger class. The ui wrapper will
be removed later.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 16:58:22 +0900] rev 40643
blackbox: rename variables to prepare extracting core logic from ui wrapper
I'm going to add ui.setlogger() function so that I can enable logging feature
in command server without extending ui.__class__. This prepares for it.
"self" will be a logger instance, so this patch renames some of them to "ui".
Boris Feld <boris.feld@octobus.net> [Fri, 09 Nov 2018 17:58:37 +0100] rev 40642
sparse-revlog: rework the way we enforce chunk size limit
We move from a O(N) algorithm to a O(log(N)) algorithm.
The previous algorithm was traversing the whole delta chain, looking for the
exact point where it became too big. This would result in most of the delta
chain to be traversed.
Instead, we now use a "binary" approach, slicing the chain in two until we
have a chunk of the appropriate size.
We still keep the previous algorithm for the snapshots part. There are few of
them and they are large bits of data distant from each other. So the previous
algorithm should work well in that case.
To take a practical example of restoring manifest revision '
59547c40bc4c' for
a reference NetBeans repository (using sparse-revlog). The media time of the
step `slice-sparse-chain` of `perfrevlogrevision` improve from 1.109 ms to
0.660 ms.
Boris Feld <boris.feld@octobus.net> [Tue, 13 Nov 2018 15:06:29 +0100] rev 40641
doctest: add a `issnapshot` method to _testrevlog
We'll need it soon.
Boris Feld <boris.feld@octobus.net> [Tue, 13 Nov 2018 14:41:04 +0100] rev 40640
tests: add `revlogutils.deltas` module to doctests
The doctest in these module have been from `mercurial.revlog` but the module was
not added to the doctests.
Spotted by Yuya Nishihara.
Yuya Nishihara <yuya@tcha.org> [Thu, 15 Nov 2018 20:20:31 +0900] rev 40639
merge with stable
joco <joco@google.com> [Mon, 05 Nov 2018 22:58:19 +0100] rev 40638
mergetools: adjust Beyond Compare config on Mac/Linux
Set the labels of the Linux and Mac versions of Beyond Compare from
Mercurial's builtin variables, same as the Windows version.
Differential Revision: https://phab.mercurial-scm.org/D5255
Augie Fackler <augie@google.com> [Wed, 14 Nov 2018 11:52:13 -0500] rev 40637
tests: allow for 100% of profiled time in sleep in test-profile.t
I'm getting an annoying failure in this test on our builder, and I
*think* what's happening is that the profiler is taking _just_ long
enough to start that we're spending 100% of the profiled time in the
sleep function, which was causing the leading space to not be printed
since the 100 was in the first column of output.
Differential Revision: https://phab.mercurial-scm.org/D5272
Anton Shestakov <av6@dwimlabs.net> [Wed, 14 Nov 2018 15:05:38 +0800] rev 40636
rewriteutil: move publicrevs closer to where it's used
Martin von Zweigbergk <martinvonz@google.com> [Wed, 14 Nov 2018 11:30:46 -0800] rev 40635
requires: use atomictemp=True when writing .hg/requires
We use an unusual file system at Google that allows writes (and
renames) but not deletions (for certain paths). That causes problems
when writing the requires files without atomictemp=True. There doesn't
appear to be any real drawbacks to using atomictemp, so I'm hoping we
can just change it in core.
Differential Revision: https://phab.mercurial-scm.org/D5274
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 16:47:28 +0900] rev 40634
blackbox: extract _log() function which is called after lastui is resolved
This makes sure that self is the solo ui instance used in _log().
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 16:44:30 +0900] rev 40633
blackbox: inline temporary variables which are referenced only once
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 16:43:29 +0900] rev 40632
blackbox: simply update global lastui variable at once
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 16:38:43 +0900] rev 40631
blackbox: consolidate conditions for early return
Just pick the lastui only if it is usable.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 16:34:49 +0900] rev 40630
blackbox: remove redundant check for unassigned repo
Since ui._bbvfs is looked through ui._bbrepo, the repo instance should
exist if ui._bbvfs isn't None.
Augie Fackler <augie@google.com> [Wed, 14 Nov 2018 10:15:28 -0500] rev 40629
tests: fix bytes/str issue I introduced when adding this test
# skip-blame just b prefixes for py3
Differential Revision: https://phab.mercurial-scm.org/D5271
Kyle Lippincott <spectral@google.com> [Tue, 13 Nov 2018 17:14:47 -0800] rev 40628
shelve: use matcher to restrict prefetch to just the modified files
Shelve currently operates by:
- make a temp commit
- identify all the bases necessary to shelve, put them in the bundle
- use exportfile to export the temp commit to the bundle ('file' here means
"export to this fd", not "export this file")
- remove the temp commit
exportfile calls prefetchfiles, and prefetchfiles uses a matcher to restrict
what files it's going to prefetch; if it's not provided, it's alwaysmatcher.
This means that `hg shelve` in a remotefilelog repo can possibly download the
file contents of everything in the repository, even when it doesn't need to. It
luckily is restricted to the narrowspec (if there is one), but this is still a
lot of downloading that's just unnecessary, especially if there's a "smart"
VCS-aware filesystem involved.
exportfile is called with exactly one revision to emit, so we're just
restricting it to prefetching the files from that revision. The base revisions
having separate files should not be a concern since they're handled already;
example:
commit 10 is draft and modifies foo/a.txt and foo/b.txt
commit 11 is draft and modifies foo/a.txt
my working directory that I'm shelving modifies foo/b.txt
By the time we get to exportfile, commit 10 and 11 are already handled, so the
matcher only specifying foo/b.txt does not cause any problems. I verified this
by doing an `hg unbundle` on the bundle that shelve produces, and getting the
full contents of those commits back out, instead of just the files that were
modified in the shelve.
Differential Revision: https://phab.mercurial-scm.org/D5268
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 13 Nov 2018 12:32:05 -0800] rev 40627
revlog: automatically read from opened file handles
The revlog reading code commonly opens a new file handle for
reading on demand. There is support for passing a file handle
to revlog.revision(). But it is marked as an internal argument.
When revlogs are written, we write() data as it is available. But
we don't flush() data until all revisions are written.
Putting these two traits together, it is possible for an in-process
revlog reader during active writes to trigger the opening of a new
file handle on a file with unflushed writes. The reader won't have
access to all "available" revlog data (as it hasn't been flushed).
And with the introduction of the previous patch, this can lead to
the revlog raising an error due to a partial read.
I witnessed this behavior when applying changegroup data (via
`hg pull`) before
issue6006 was fixed via different means. Having
this and the previous patch in play would have helped cause errors
earlier rather than manifesting as hash verification failures.
While this has been a long-standing issue, I believe the relatively
new delta computation code has tickled it into being more common.
This is because the new delta computation code will compute deltas
in more scenarios. This can lead to revlog reading. While the delta
computation code is probably supposed to reuse file handles, it
appears it isn't doing so in all circumstances.
But the issue runs deeper than that. Theoretically, any code can
access revision data during revlog writes. It appears we were just
getting lucky that it wasn't. (The "add revision callback" passed to
addgroup() provides an avenue to do this.)
If I changed the revlog's behavior to not cache the full revision
text or to clear caches after revision insertion during addgroup(),
I was able to produce crashes 100% of the time when writing changelog
revisions. This is because changelog's add revision callback attempts
to resolve the revision data to access the changed files list. And
without the revision's fulltext being cached, we performed a revlog
read, which required opening a new file handle. This attempted to read
unflushed data, leading to a partial read and a crash.
This commit teaches the revlog to store the file handles used for
writing multiple revisions during addgroup(). It also teaches the
code for resolving a file handle when reading to use these handles,
if available. This ensures that *any* reads (regardless of their
source) use the active writing file handles, if available. These
file handles have access to the unflushed data because they wrote it.
This allows reads to complete without issue.
Differential Revision: https://phab.mercurial-scm.org/D5267
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 13 Nov 2018 12:30:59 -0800] rev 40626
revlog: detect incomplete revlog reads
_readsegment() is supposed to return N bytes of revlog revision
data starting at a file offset. Surprisingly, its behavior before
this patch never verified that it actually read and returned N
bytes! Instead, it would perform the read(), then return whatever
data was available. And even more surprisingly, nothing in the
call chain appears to have been validating that it received all
the data it was expecting.
This behavior could lead to partial or incomplete revision chunks
being operated on. This could result in e.g. cached deltas being
applied against incomplete base revisions. The delta application
process would happily perform this operation. Only hash
verification would detect the corruption and save us.
This commit changes the behavior of raw revlog reading to validate
that we actually read() the number of bytes that were requested.
We will raise a more specific error faster, rather than possibly
have it go undetected or manifest later in the call stack, at
delta application or hash verification.
Differential Revision: https://phab.mercurial-scm.org/D5266
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 30 Oct 2018 16:50:05 -0700] rev 40625
revlog: use single file handle when de-inlining revlog
_getsegmentforrevs() will eventually call into _datareadfp() to
resolve a file handle to read revision data. If no file handle
is passed into _getsegmentforrevs(), it opens a new one.
Explicit is better than implicit.
This commit changes _enforceinlinesize() to open a file handle
explicitly when converting inline revlogs to split revlogs and
to pass this file handle into _getsegmentforrevs().
I haven't measured, but this change should improve performance,
as we no longer reopen the revlog for reading for every revision
in the revlog when it is converted from inline to split. Instead,
we open it at most once and use it for the duration of the
operation. That being said, I /think/ the chunk cache may mitigate
the number of file opens required.
Differential Revision: https://phab.mercurial-scm.org/D5265
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 13 Nov 2018 18:44:09 +0300] rev 40624
store: raise ProgrammingError if unable to decode a storage path
Right now, the function magically return False which is dangerous, so let's
raise ProgrammingError.
Suggested by Augie in D5139.
Differential Revision: https://phab.mercurial-scm.org/D5264
Matt Harbison <matt_harbison@yahoo.com> [Tue, 13 Nov 2018 23:54:23 -0500] rev 40623
tests: document a known failing interaction between narrow and lfs
This is one of the two remaining aborts I found looking into
issue5794. I've
got no idea what's wrong with the hook, since the changes there fixed the other
two problems noted in that bug report. It seems like it might go away when the
narrow issue is fixed, but let's make sure this doesn't get lost.
The stacktrace for the hook seems to indicate that the missing file *is* in ctx:
remote: Traceback (most recent call last):
remote: File "c:\Users\Matt\projects\hg\hgext\lfs\__init__.py", line 253, in checkrequireslfs
remote: if any(f in ctx and match(f) and ctx[f].islfs() for f in ctx.files()):
remote: File "c:\Users\Matt\projects\hg\hgext\lfs\__init__.py", line 253, in <genexpr>
remote: if any(f in ctx and match(f) and ctx[f].islfs() for f in ctx.files()):
remote: File "c:\Users\Matt\projects\hg\hgext\lfs\wrapper.py", line 191, in filectxislfs
remote: return _islfs(self.filelog(), self.filenode())
remote: File "c:\Users\Matt\projects\hg\mercurial\context.py", line 631, in filenode
remote: return self._filenode
remote: File "c:\Users\Matt\projects\hg\mercurial\util.py", line 1528, in __get__
remote: result = self.func(obj)
remote: File "c:\Users\Matt\projects\hg\mercurial\context.py", line 579, in _filenode
remote: return self._filelog.lookup(self._fileid)
remote: File "c:\Users\Matt\projects\hg\mercurial\filelog.py", line 68, in lookup
remote: self._revlog.indexfile)
remote: File "c:\Users\Matt\projects\hg\mercurial\utils\storageutil.py", line 218, in fileidlookup
remote: raise error.LookupError(fileid, identifier, _('no match found'))
remote: LookupError: data/inside2/f.i@
f59b4e021835: no match found
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 12:55:58 +0900] rev 40622
logtoprocess: drop support for ui.log() call with invalid msg arguments (BC)
Before, the logtoprocess extension put a formatted message into $MSG1, and
its arguments to $MSG2... If the specified arguments couldn't be formatted
because of a caller bug, an unformatted message was passed in to $MSG1
instead of exploding. This behavior doesn't make sense.
Since I'm planning to formalize the ui.log() interface such that we'll no
longer have to extend the ui class, I want to remove any features not
conforming to the ui.log() API. So this patch removes the support for
ill-formed arguments, and $MSG{n} (where n > 1) parameters which seems
useless as long as the message can be formatted. The $MSG1 variable isn't
renamed for the maximum compatibility.
In future patches, a formatted msg will be passed to a processlogger object,
instead of overriding the ui.log() function.
.. bc::
The logtoprocess extension no longer supports invalid ``ui.log()``
arguments. A log message is always formatted and passed in to the
``$MSG1`` environment variable.
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 12:35:38 +0900] rev 40621
py3: byte-stringify inline extension in test-logtoprocess.t
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 12:33:14 +0900] rev 40620
logtoprocess: rewrite dict building in py3-compatible way
Yuya Nishihara <yuya@tcha.org> [Sun, 11 Nov 2018 12:27:23 +0900] rev 40619
logtoprocess: leverage procutil.shellenviron() to stringify variables (BC)
This should make the extension more Py3 friendly. The environment variables
of the main process are copied to the dict by shellenviron().
.. bc::
Boolean options passed to the logtoprocess extension are now formatted
as ``0`` or ``1`` instead of ``None``, ``False``, or ``True``.
Yuya Nishihara <yuya@tcha.org> [Tue, 13 Nov 2018 22:15:30 +0900] rev 40618
templater: check invalid use of list expression properly (
issue5920)
The error message is still cryptic, but it should be better.
Anton Shestakov <av6@dwimlabs.net> [Wed, 14 Nov 2018 15:06:21 +0800] rev 40617
copystore: provide unit to ui.makeprogress()
Anton Shestakov <av6@dwimlabs.net> [Wed, 14 Nov 2018 15:07:02 +0800] rev 40616
verify: provide unit to ui.makeprogress()
Augie Fackler <augie@google.com> [Tue, 13 Nov 2018 19:47:48 -0500] rev 40615
tests: fix wireproto redirection test on systems without tls1.2
Our automated package builder has some ancient configuration that
lacks modern TLS, which is how we noticed this.
Tested: the test now passes on both macOS High Sierra (has tls1.2) and
Ubuntu Trusty (which does not).
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 13 Nov 2018 18:08:55 +0300] rev 40614
py3: add b suffix to make sure file is opened in bytes mode
Differential Revision: https://phab.mercurial-scm.org/D5263
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 13 Nov 2018 18:08:17 +0300] rev 40613
py3: don't use dict.iterkeys()
dict.iterkeys() is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5262
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 13 Nov 2018 18:07:21 +0300] rev 40612
py3: use node.hex(h.digest()) instead of h.hexdigest()
hashlib.sha1.hexdigest() returns str on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5261
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 13 Nov 2018 17:41:54 +0300] rev 40611
py3: make second argument of fdopen() a str
# skip-blame as just r'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5260
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 13 Nov 2018 17:41:26 +0300] rev 40610
py3: fix keyword arguments handling in hgext/remotefilelog/
Keys of kwargs on Python 3 should be strings. This patch fixes them by appending
r'' prefixes, and using pycompat.byteskwargs() and pycompat.strkwargs().
Differential Revision: https://phab.mercurial-scm.org/D5259
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 13 Oct 2018 05:09:18 +0300] rev 40609
py3: add __pycache__ to .hgignore
Something changed with Python 3 just like million on things. Maybe they should
named Python 3 as anaconda or cobra instead of just increasing the version
number.
This makes test-custom-filters.t pass on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5039
Boris Feld <boris.feld@octobus.net> [Thu, 08 Nov 2018 16:07:16 +0100] rev 40608
sparse-revlog: stop using a heap to track selected gap
Same logic as for 'gapsheap', we don't actually need a heap.
Boris Feld <boris.feld@octobus.net> [Thu, 08 Nov 2018 16:01:30 +0100] rev 40607
sparse-revlog: stop using a heap to track gaps
The heap doesn't bring any performance advantage as we can simply sort the
final list.
Moreover, the lesser complexity helps a lot when we later implement it in C.
Boris Feld <boris.feld@octobus.net> [Thu, 08 Nov 2018 15:29:58 +0100] rev 40606
sparse-revlog: fast-path before computing payload size
In this fast-path case, we do not need to compute the full delta chain
payload. Since it comes with a significant cost, we avoid doing so if
possible.
Boris Feld <boris.feld@octobus.net> [Tue, 16 Oct 2018 14:46:28 +0200] rev 40605
sparse-revlog: drop unused deltainfo parameter from segmentspan
We no longer need to deal with slicing logic including uncommitted revision.
We drop the associated code.
Boris Feld <boris.feld@octobus.net> [Tue, 16 Oct 2018 14:43:51 +0200] rev 40604
sparse-revlog: drop unused deltainfo parameter from _slicechunktodensity
We no longer need to deal with slicing logic including uncommitted revision. We
drop the associated code.
Boris Feld <boris.feld@octobus.net> [Mon, 15 Oct 2018 15:45:08 +0200] rev 40603
sparse-revlog: skip the span check in the sparse-revlog case
This significantly improves the performance on unbundling on smaller
repositories.
Mercurial: unbundling 1K revisions
no-sparse-revlog: 500 ms
sparse-revlog-before: 689 ms
sparse-revlog-after: 484 ms
Pypy: unbundling 1K revisions
no-sparse-revlog: 1.242 s
sparse-revlog-before: 1.135 s
sparse-revlog-after: 0.860 s
NetBeans: unbundling 1K revisions
no-sparse-revlog: 1.386 s
sparse-revlog-before: 2.368 s
sparse-revlog-after: 1.191 s
Mozilla: unbundling 1K revisions
no-sparse-revlog: 3.103 s
sparse-revlog-before: 3.367 s
sparse-revlog-after: 3.093 s
Augie Fackler <augie@google.com> [Wed, 17 Oct 2018 17:15:42 -0400] rev 40602
histedit: import chistedit curses UI from hg-experimental
I don't tend to like curses interfaces, but this gets enough use at
work that it seems like it's worth bringing into core. This is a
minimal import from hg-experimental revision
4c7f33bf5f00, in that
I've done the smallest amount of code movement and editing in order to
import the functionality.
.. feature::
`hg histedit` will now present a curses UI if curses is available
and `ui.interface` or `ui.interface.histedit` is set to `curses`.
Differential Revision: https://phab.mercurial-scm.org/D5146
Augie Fackler <augie@google.com> [Mon, 12 Nov 2018 20:32:58 -0500] rev 40601
manifest: perform cheap checks before potentially allocating memory
Differential Revision: https://phab.mercurial-scm.org/D5258
Augie Fackler <augie@google.com> [Mon, 12 Nov 2018 20:31:57 -0500] rev 40600
manifest: also reject obviously-too-short lines when parsing lines
Differential Revision: https://phab.mercurial-scm.org/D5257
Augie Fackler <augie@google.com> [Mon, 12 Nov 2018 20:35:22 -0500] rev 40599
manifest: make sure there's a filename before bothering to look for newline
There's no valid manifest that would have no characters before the NUL byte on
a line, and this fixes some erratic timeouts in the fuzzer.
Differential Revision: https://phab.mercurial-scm.org/D5256
Augie Fackler <augie@google.com> [Tue, 06 Nov 2018 11:12:56 -0500] rev 40598
revlog: replace PyInt_AS_LONG with a more portable helper function
PyInt_AS_LONG disappears on Python, and our previous #define was
producing some problems on Python 3. Let's give up and make an inline
helper function that makes this more sane.
Differential Revision: https://phab.mercurial-scm.org/D5235
Yuya Nishihara <yuya@tcha.org> [Mon, 12 Nov 2018 22:51:36 +0900] rev 40597
help: document weird behavior of uisetup()
While refactoring ui.log() API, it was really annoying that uisetup() is
actually an extsetup() the phase 1. Let's document that. I'm planning to
add another uisetup() which is called per ui instance, though I can't think
of a good name for it.
Yuya Nishihara <yuya@tcha.org> [Mon, 12 Nov 2018 22:26:24 +0900] rev 40596
help: merge section about uisetup() and extsetup()
They are technically the same callback, called only once per process.
The section name "ui setup" is confusing, so shouldn't be used.
Yuya Nishihara <yuya@tcha.org> [Mon, 12 Nov 2018 21:28:54 +0900] rev 40595
help: add internals.extensions topic
I think it's better to include the API overview in core as we now have the
internals section in our help system.
Retrieved from the wiki, and formatted as reST. Several wiki links are
removed since they are invalid in the help. The sections about example
extension are removed at all as they seemed too verbose.
https://www.mercurial-scm.org/wiki/WritingExtensions
Yuya Nishihara <yuya@tcha.org> [Sun, 04 Nov 2018 12:51:14 +0900] rev 40594
commandserver: send raw progress information to message channel
This is pretty basic implementation to support GUI progress bar.
Yuya Nishihara <yuya@tcha.org> [Sun, 04 Nov 2018 12:38:49 +0900] rev 40593
commandserver: make getpass() request distinct from normal prompt
Otherwise, GUI clients would have to parse the prompt text.
Yuya Nishihara <yuya@tcha.org> [Sun, 04 Nov 2018 12:17:20 +0900] rev 40592
commandserver: attach prompt default and choices to message
These attributes are important to provide a GUI prompt to user.
Yuya Nishihara <yuya@tcha.org> [Thu, 08 Nov 2018 22:25:04 +0900] rev 40591
test-commandserver: clean up quoting and location of dbgui extension
This helps embedding '$' in the script.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Jan 2015 17:55:28 +0900] rev 40590
ui: extract helpers to write message with type or label
This provides a 'type' attribute to command-server clients, which seems
more solid than relying on 'ui.<type>' labels. In future patches,
type='progress' will be added to send raw progress information.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Jan 2015 18:49:59 +0900] rev 40589
commandserver: add experimental option to use separate message channel
This is loosely based on the idea of the TortoiseHg's pipeui extension,
which attaches ui.label to message text so the command-server client can
capture prompt text, for example.
https://bitbucket.org/tortoisehg/thg/src/4.7.2/tortoisehg/util/pipeui.py
I was thinking that this functionality could be generalized to templating,
but changed mind as doing template stuff would be unnecessarily complex.
It's merely a status message, a simple serialization option should suffice.
Since this slightly changes the command-server protocol, it's gated by a
config knob. If the config is enabled, and if it's supported by the server,
"message-encoding: <name>" is advertised so the client can stop parsing
'o'/'e' channel data and read encoded messages from the 'm' channel. As we
might add new message encodings in future releases, client can specify a list
of encoding names in preferred order.
This patch includes 'cbor' encoding as example. Perhaps, 'json' should be
supported as well.
Yuya Nishihara <yuya@tcha.org> [Wed, 07 Nov 2018 22:37:51 +0900] rev 40588
commandserver: fix reference before assignment error in pipeservice cleanup
Spotted by the next patch.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Jan 2015 18:43:23 +0900] rev 40587
dispatch: pass around ui.fmsg channel
This will be set by the command server. See the next patch.
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Nov 2018 12:01:21 +0900] rev 40586
test-subrepo: document why share magically works even if subrepos are missing
I was confused how it's working while reviewing
fb490d798be0, "share: reload
repo after adjusting it in postshare()."
Augie Fackler <raf@durin42.com> [Sun, 11 Nov 2018 14:13:08 -0500] rev 40585
packaging: add Fedora 29 target
Differential Revision: https://phab.mercurial-scm.org/D5254
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Nov 2018 11:52:32 +0900] rev 40584
store: pass in decoded filename to narrow matcher
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Nov 2018 11:47:36 +0900] rev 40583
test-narrow-clone-stream: include no usefncache case which is broken
Since
9aeb9e2d28a7, encoded filenames are filtered by the narrow matcher,
which is clearly wrong.
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Nov 2018 11:36:22 +0900] rev 40582
test-narrow-clone-stream: include uppercase letter in filename
This makes encoded filenames differ from the original names.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Nov 2018 13:37:18 -0500] rev 40581
phase: use the `phases.cmdphasenames` constant to walk available command flags
This reverts
1ea6772fb415.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 09 Nov 2018 23:19:53 -0500] rev 40580
phases: add a list of names usable by the phase command
This is useful in TortoiseHg for example, which has until recently just added
all names in the `phasenames` list to the context menu that changes the phase.
The ones not supported by the command would just error out.
Boris Feld <boris.feld@octobus.net> [Wed, 07 Nov 2018 19:59:38 +0100] rev 40579
transaction: display data about why the transaction failed to rollback
We saw more of these a while back. Having more data available would be nice.
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Nov 2018 12:07:26 +0900] rev 40578
merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Fri, 09 Nov 2018 10:47:24 -0800] rev 40577
remotefilelog: avoid accessing repo instance after dispatch
Upstream commit
c5e6c1ba1c79 (hg: don't reuse repo instance after
unshare(), 2018-09-12) poisoned the repo instance after
unshare(). That made `hg unshare` fail with remotefilelog because we
tried to close the fileserverclient after dispatch by accessing it via
the repo. This patch fixes that by storing the reference to the
fileserverclient at the beginning of dispatch.
An analogous patch was sent for remotefilelog version in FB's
hg-experimental as D5246.
Differential Revision: https://phab.mercurial-scm.org/D5253
Martin von Zweigbergk <martinvonz@google.com> [Fri, 09 Nov 2018 11:28:05 -0800] rev 40576
share: avoid a now-unnecessary reload of the repo
hg.share() now returns an already-reloaded repo, so let's just use
that. (This would have failed test-subrepo-recursion.t without the
previous patch.)
Differential Revision: https://phab.mercurial-scm.org/D5252
Martin von Zweigbergk <martinvonz@google.com> [Fri, 09 Nov 2018 10:46:02 -0800] rev 40575
share: reload repo after adjusting it in postshare()
When sharing a repo that's using remotefilelog, the update that happens
at the end of the `hg share` call does not see the remote repo path
that's copied in hg.postshare(). This patch reloads the repo after
hg.postshare() to address that.
This changes a subrepo test case. Note that `hg share -U; hg co tip`
worked there before, so I don't see see why `hg share` should fail. I
also don't know what a "locally referenced subrepo". So maybe this is
fixing a bug? Hopefully it's not breaking something someone actually
cares about at least. Maybe someone who knows and cares about subrepos
can review this.
Differential Revision: https://phab.mercurial-scm.org/D5251
Martin von Zweigbergk <martinvonz@google.com> [Fri, 09 Nov 2018 09:36:16 -0800] rev 40574
tests: don't load strip extension via mq extension for remotefilelog tests
The proper way to get the `hg strip` command has been via the "strip"
extension since 2013.
Differential Revision: https://phab.mercurial-scm.org/D5250
Martin von Zweigbergk <martinvonz@google.com> [Fri, 09 Nov 2018 09:35:05 -0800] rev 40573
remotefilelog: remove unused configs for {data,history}pack version
Differential Revision: https://phab.mercurial-scm.org/D5249
Martin von Zweigbergk <martinvonz@google.com> [Fri, 09 Nov 2018 09:27:37 -0800] rev 40572
tests: remove obsolete PYTHONPATH override from remotefilelog tests
They were added in
https://bitbucket.org/facebook/hg-experimental/commits/
fdcad37a6a68cfbaf5920f3eeaa0cc9cae42bd26,
which says this:
When remotefilelog moved from its own repo, the tests needed to be updated to
adjust the PYTHONPATH to ensure the in-repo remotefilelog was loaded instead of
the system one.
This meant any local runs of remotefilelog tests would've been using the system
remotefilelog unless the user had manually set the PYTHONPATH themselves.
That doesn't seem relevant with remotefilelog in core.
Differential Revision: https://phab.mercurial-scm.org/D5248
Martin von Zweigbergk <martinvonz@google.com> [Fri, 09 Nov 2018 08:19:08 -0800] rev 40571
tests: drop obsolete "hginit" alias in remotefilelog tests
Differential Revision: https://phab.mercurial-scm.org/D5247
Danny Hooper <hooper@google.com> [Thu, 08 Nov 2018 12:35:26 -0800] rev 40570
fix: add extra field to fixed revisions to avoid creating obsolescence cycles
The extra field prevents sequential invocations of fix from producing the same
hash twice. Previously, this could cause problems because it would create an
obsolescence cycle instead of the expected new successor.
This change also adds an explicit check for whether a new revision should be
committed. Until now, the code relied on memctx.commit() to quietly do nothing
if the node already exists. Because of the new extra field, this no longer
covers the case where we don't want to replace an unchanged node.
Differential Revision: https://phab.mercurial-scm.org/D5245
Danny Hooper <hooper@google.com> [Thu, 08 Nov 2018 12:29:56 -0800] rev 40569
cleanup: use revision numbers instead of hashes in test output
This allows changes to the hashes produced by fix to not needlessly modify this
area of the test.
Differential Revision: https://phab.mercurial-scm.org/D5244
Kyle Lippincott <spectral@google.com> [Wed, 07 Nov 2018 15:42:56 -0800] rev 40568
tests: make the commands.resolve.confirm tests not pollute the test-wide hgrc
I want to add tests after these tests that create a new repo and use it, and was
confused for a bit as to why they were seeing different behavior than I
expected.
Differential Revision: https://phab.mercurial-scm.org/D5242
Kyle Lippincott <spectral@google.com> [Wed, 07 Nov 2018 15:41:18 -0800] rev 40567
tests: fix a couple typos in test-resolve.t comments and add a comment
Differential Revision: https://phab.mercurial-scm.org/D5241
Danny Hooper <hooper@google.com> [Tue, 06 Nov 2018 15:50:41 -0800] rev 40566
fix: add suboption for configuring execution order of tools
This could be accomplished by using wrapper scripts, but that would diminish
the usefulness of the incremental formatting logic. Configuring execution order
along with other things in the hgrc is probably more convenient anyway.
This change highlights some awkwardness with suboptions and default values,
which should be addressed separately.
Differential Revision: https://phab.mercurial-scm.org/D5237
Augie Fackler <augie@google.com> [Wed, 07 Nov 2018 14:21:39 -0500] rev 40565
tests: fix up some import statements caught by Python 3
I'm curious how the import checker manages to be so much more
pedantic in Python 3, but not enough to bother exploring.
Differential Revision: https://phab.mercurial-scm.org/D5240
Martin von Zweigbergk <martinvonz@google.com> [Wed, 07 Nov 2018 10:29:38 -0800] rev 40564
tests: replace `tac` reimplementation by `sort -r`
`sort -r` is better code "formatter" than `tac` since it's
stable. It's also portable so we don't need to reimplement it in
Python.
Differential Revision: https://phab.mercurial-scm.org/D5239
Augie Fackler <augie@google.com> [Wed, 07 Nov 2018 12:15:36 -0500] rev 40563
tests: work around `tac` not being portable
Introduce a tac.py helper and use it. Sigh.
Differential Revision: https://phab.mercurial-scm.org/D5238
Augie Fackler <augie@google.com> [Tue, 06 Nov 2018 11:22:16 -0500] rev 40562
revlog: give formatting to clang-format
This has two lines that are poorly formatted, both right after
PyObject_HEAD macros. It's possible that in the future there will be a
feature to tell clang-format that a token includes an end-of-line
character (in this case the ;), but for now I'm willing to live with
two poorly-formatted lines in a struct definition in exchange for not
thinking about how this file is formatted.
Differential Revision: https://phab.mercurial-scm.org/D5234
Augie Fackler <augie@google.com> [Tue, 06 Nov 2018 11:19:35 -0500] rev 40561
revlog: add blank line in comment to help clang-format
Differential Revision: https://phab.mercurial-scm.org/D5233
Augie Fackler <augie@google.com> [Tue, 06 Nov 2018 11:18:12 -0500] rev 40560
revlog: add a comment to help clang-format produce less-awful results
Differential Revision: https://phab.mercurial-scm.org/D5232
Augie Fackler <augie@google.com> [Tue, 06 Nov 2018 11:52:41 -0500] rev 40559
py3: ratchet caught two more passing tests
Differential Revision: https://phab.mercurial-scm.org/D5236
Boris Feld <boris.feld@octobus.net> [Mon, 05 Nov 2018 15:57:31 +0100] rev 40558
perf: add a lazydeltabase option to perfrevlogwrite
The option controls if we'll test the provided delta first. This is the current
default behavior for unbundle.
Boris Feld <boris.feld@octobus.net> [Mon, 05 Nov 2018 15:24:09 +0100] rev 40557
perf: add `storage` as possible source for perfrevlogwrite
This source will use the stored delta.
Boris Feld <boris.feld@octobus.net> [Mon, 05 Nov 2018 15:19:44 +0100] rev 40556
perf: add `parent-smallest` as possible source for perfrevlogwrite
This source will use the smallest of the possible diff against parent.
Boris Feld <boris.feld@octobus.net> [Mon, 05 Nov 2018 15:15:18 +0100] rev 40555
perf: add `parent-2` as possible source for perfrevlogwrite
This source will use a diff against p2 if it exists and fall back to p1
otherwise.
Boris Feld <boris.feld@octobus.net> [Mon, 05 Nov 2018 15:15:02 +0100] rev 40554
perf: add `parent-1` as possible source for perfrevlogwrite
This source will use a diff against p1 in all case.
Boris Feld <boris.feld@octobus.net> [Fri, 19 Oct 2018 17:23:29 +0200] rev 40553
perf: add the notion of "source" to perfrevlogwrite
We want to test performance associated witch various way to add a new revision.
They will be specified using this new argument.
Boris Feld <boris.feld@octobus.net> [Tue, 06 Nov 2018 00:57:34 +0100] rev 40552
perf: only display the total time for perfrevlogwrite if quiet
This provide a simple way to get an overview of the total performance.
Boris Feld <boris.feld@octobus.net> [Wed, 03 Oct 2018 11:04:57 +0200] rev 40551
perf: offer full details in perfrevlogwrite
This will be useful for people who want to study the timing pattern more
closely.
Boris Feld <boris.feld@octobus.net> [Wed, 03 Oct 2018 10:53:29 +0200] rev 40550
perf: introduce a perfrevlogwrite command
The command record times taken by adding many revisions to a revlog. Timing
each addition, individually. The "added revision" are recreations of the
original ones.
To time each addition individually, we have to handle the timing and the
reporting ourselves.
This command is introduced to track the impact of sparse-revlog format on
delta computations at initial storage time. It starts with the full text, a
situation similar to the "commit". Additions from an existing delta are better
timed with bundles.
The complaints from `check-perf-code.py` are not relevant. We are accessing
and "revlog" opener, not a repository opener.
Augie Fackler <augie@google.com> [Tue, 06 Nov 2018 10:41:00 -0500] rev 40549
tests: fix config knob in test-narrow-clone-stream.t
Two patches landed in parallel and had a semantic conflict. This
resolves the mess and leaves us with passing tests.
Differential Revision: https://phab.mercurial-scm.org/D5231
Augie Fackler <augie@google.com> [Tue, 06 Nov 2018 10:26:33 -0500] rev 40548
remotefilelog: fix various whitespace issues in docstring
Differential Revision: https://phab.mercurial-scm.org/D5230
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Nov 2018 19:42:50 +0900] rev 40547
ui: add config knob to redirect status messages to stderr (API)
This option can be used to isolate structured output from status messages.
For now, "stdio" (stdout/err pair) and "stderr" are supported. In future
patches, I'll add the "channel" option which will send status messages to
a separate command-server channel with some metadata attached, maybe in
CBOR encoding.
This is a part of the generic templating plan:
https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Sanity_check_output
.. api::
Status messages may be sent to a dedicated stream depending on
configuration. Don't use ``ui.status()``, etc. as a shorthand for
conditional writes. Use ``ui.write()`` for data output.