FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 13:57:01 +0900] rev 39266
filemerge: make capability check for internal tools ignore merge-tools section
This is follow up of
4d7b11877dd0.
Before this patch, capability check of internal merge tools falls back
to _toolbool(), which examines configurations in "merge-tools" section.
But "hg help config" explicitly says that "merge-tools" section
configures external merge tools.
Therefore, this patch makes capability check for internal tools in
hascapability() always ignore configurations in merge-tools section.
In this patch, command line configurations below are added at tests in
tests/test-merge-tools.t, in order to confirm that explicit
configuration is intentionally ignored at tool selection.
--config merge-tools.:INTERNAL_TOOL.CAPABILITY=true
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Aug 2018 22:21:04 -0700] rev 39265
merge with stable
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 24 Aug 2018 18:21:55 -0700] rev 39264
scmutil: avoid quadratic membership testing (
issue5969)
tr.changes['revs'] is an xrange, which has an O(n) __contains__
implementation. The `rev not in newrevs` lookup a few lines below
will therefore be O(n^2) if all incoming changesets are public.
This issue isn't present on @ because
45e05d39d9ce introduced
a custom type implementing an xrange primitive with O(1) contains
and switched tr.changes['revs'] to be an instance of that type.
We work around the problem on the stable branch by casting the
xrange to a set. This is a bit hacky because it requires allocating
memory to hold each integer in the range. But we are already
holding the full set of pulled revision numbers in memory
multiple times (such as in `tr.changes['phases']`). So this is
a relatively minor problem.
This issue has been present since the phases reporting code was
introduced in the 4.7 cycle by
eb9835014d20.
This change should be reverted/ignored when stable is merged into
default.
On the mozilla-unified repository with 483492 changesets, `hg clone`
time improves substantially:
before: 1843.700s user; 29.810s sys
after: 461.170s user; 29.360s sys
Kyle Lippincott <spectral@google.com> [Wed, 15 Aug 2018 14:41:27 -0700] rev 39263
copies: correctly skip directories that have already been considered
Previously, `if dsrc in invalid` would never be true, since we added
`dsrc +"/"` to invalid, not `dsrc` itself. Since it's much more common for
individual files (not whole directories) to be moved, it seemed cleaner to
delay appending the "/" until we know we have some directory moves to
actually consider.
I haven't benchmarked this, but I imagine this is a mild performance win.
Differential Revision: https://phab.mercurial-scm.org/D4284
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Aug 2018 12:55:05 -0700] rev 39262
merge with stable
Kyle Lippincott <spectral@google.com> [Fri, 24 Aug 2018 10:19:31 -0700] rev 39261
match: make exactmatcher.visitchildrenset return file children as well
Previously, if we had an exactmatcher like ['foo.txt', 'a/bar.txt', 'a/b/c/baz.txt'], we'd
get back the following data:
'.': {'a'}
'a': {'b'}
'a/b': {'c'}
'a/b/c': 'this'
'a/b/c/d': set()
This was incorrect, since visitchildrenset explicitly says not to pay attention
to 'foo.txt' and 'a/bar.txt' by not returning them or 'this'. Given the near
impossibility of making visitchildrenset reliabbly produce only subdirectories,
a previous commit has made it documented and expected that visitchildrenset can
return a set containing both files and subdirectories to visit, instead of
implying/requiring that visitchildrenset() return 'this' if there are files to
visit. This makes the code for exactmatcher match this clarified documentation.
Differential Revision: https://phab.mercurial-scm.org/D4365
Kyle Lippincott <spectral@google.com> [Thu, 23 Aug 2018 18:04:15 -0700] rev 39260
match: document that visitchildrenset might return files
At least when using includematcher, and probably most matchers, we do not know
if a/b/f refers to a file 'f' in a/b, or a subdirectory 'f' in a/b, so most
matchers will return {'f'} for visitchildrenset('a/b'). Arguably, all matchers
could/should - for exactmatcher, we know that 'f' is a file, but there's no
reason to return 'this' for visitchildrenset('a/b') causing code to investigate
'a/b/x', for example.
Differential Revision: https://phab.mercurial-scm.org/D4364
Augie Fackler <augie@google.com> [Fri, 24 Aug 2018 10:13:27 -0700] rev 39259
util: make timedcm require the label (API)
Differential Revision: https://phab.mercurial-scm.org/D4350
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 17:15:51 -0400] rev 39258
cleanup: make all uses of timedcm specify what they're timing
It's not used in the timing itself, but it's valuable for the trace
events we emit.
Differential Revision: https://phab.mercurial-scm.org/D4349
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 17:13:35 -0400] rev 39257
util: make timedcm context manager also emit trace events
Differential Revision: https://phab.mercurial-scm.org/D4348
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:27:30 -0400] rev 39256
demandimport: instrument python 2 code with trace events
This causes the evaluation of an import in Python 3 to emit some trace
data. There's some interesting wrinkles in here, like the fact that
before we even hit dispatch we've demand-imported `sys` several times,
despite the fact that `sys` was already fully loaded as one of the
first few statements in the `hg` script. I don't think that's actually
costing us a ton of performance, but it's probably something we should
investigate fixing some day.
Differential Revision: https://phab.mercurial-scm.org/D4347
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:25:07 -0400] rev 39255
dispatch: have dispatch.dispatch and dispatch._runcatch emit trace events
Differential Revision: https://phab.mercurial-scm.org/D4345
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:24:20 -0400] rev 39254
tracing: new module to make tracing events in hg easier
This lives in hgdemandimport because I want to instrument a bunch of
low-level stuff including the bare `hg` script and demandimport, so it
can't live at a higher layer.
Differential Revision: https://phab.mercurial-scm.org/D4344
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:23:01 -0400] rev 39253
tests: add support for emitting trace events to run-tests
Right now this is pretty basic, but it's a start.
Differential Revision: https://phab.mercurial-scm.org/D4343
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:01:09 -0400] rev 39252
contrib: new script to read events from a named pipe and emit catapult traces
I'm starting to get more serious about getting some insight into where
we're spending our time, both in hg itself but also in the test
suite. As a first pass, I'm going to try and produce catapult
traces[0] that can be viewed with Chrome's `about:tracing` tool.
0: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit#heading=h.nso4gcezn7n1
Differential Revision: https://phab.mercurial-scm.org/D4342
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 22:49:08 -0400] rev 39251
fastannotate: pconvert paths from the server for Windows
I'm guessing that the right thing to do here is to convert the paths on the
server, but I know this is a WIP, and I don't know where that needs to happen.
I'm just trying to eliminate the malicious path warnings in the tests.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 22:34:32 -0400] rev 39250
test-fastannotate: close fd before unlinking to keep Windows happy
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:43:44 -0400] rev 39249
test-fastannotate: fix trivial output differences on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:29:10 -0400] rev 39248
fastannotate: make the default value for `fastannotate.useflock` dynamic
fcntl.flock isn't available on Windows.
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 08 Aug 2018 13:56:53 +0300] rev 39247
narrow: add a --narrowspec flag to clone command
This patch adds a --narrowspec flag to `hg clone` command in narrow extension
which can be used to read a file and parse narrowspecs from it and use it while
cloning a repository.
The --narrowspec flag assumes that the user wanted to narrow the clone.
Tests are added both for ellipsis and non-ellipsis mode.
Differential Revision: https://phab.mercurial-scm.org/D4156
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 16:01:19 -0700] rev 39246
manifest: use rev() instead of nodemap.__contains__
nodemap is an implementation detail of revlogs and isn't
appropriate to expose on the manifest storage API.
While revlogs don't have a __contains__, they do have lookup()
for resolving a value to a node. And this calls rev(), whose API
is documented to raise LookupError if a node doesn't exist. And
the parameters to LookupError are identical to what was being
raised here. So this change should be backwards compatible.
Differential Revision: https://phab.mercurial-scm.org/D4279
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 15:06:41 -0700] rev 39245
manifest: rename manifestlog._treeinmem to ._treemanifests
Not sure what "inmem" was supposed to indicate. This object is an
interface to manifest data on disk as well as "in memory" (assuming
that's what "inmem" means).
Differential Revision: https://phab.mercurial-scm.org/D4278
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 15:01:06 -0700] rev 39244
manifest: add getstorage() to manifestlog and use it globally
It is a common pattern to obtain a directory manifest storage instance
(a manifestrevlog) by going through manifestlog._revlog.dirlog().
Why access to storage and caching of other manifests is done through
manifestrevlog instead of manifestlog, I don't know.
This commit establishes a getstorage(tree) API on manifestlog and
imanifestlog that provides a public API for accessing manifest storage.
All consumers previously using private attributes have been updated
to use this new method.
.. api:: manifestlog now has a getstorage(tree) method
It should be used for obtaining an object representing the
manifest's storage implementation. Accessing
manifestlog._revlog should be avoided.
Differential Revision: https://phab.mercurial-scm.org/D4277
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:44:50 -0700] rev 39243
manifest: rename dir argument and attribute to tree
dir shadows a built-in. We use it throughout the manifest code, which
is unfortunate.
This commit updates just manifestrevlog to be more well behaved.
.. api:: renamed manifest.manifestrevlog.__init__ dir argument to tree
Differential Revision: https://phab.mercurial-scm.org/D4276
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:40:02 -0700] rev 39242
manifest: set appropriate cache entry when clearing _dirlogcache()
manifestrevlog applies to any manifest, not just the root manifest.
Resetting the cache and populating its root entry with self is not
correct when the instance does not refer to the root manifest.
This has no test fallout. So I'm guessing we only ever call
clearcaches() on the root manifest. Or we have no test coverage that
are impacted by a bad cache on a non-root manifestrevlog.
Differential Revision: https://phab.mercurial-scm.org/D4275
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:20:47 -0700] rev 39241
manifest: remove addgroup() from manifestlog and imanifestlog
addgroup() is part of the storage interface for manifests.
Unfortunately, we don't yet have a formal storage interface
for manifests. (One will be established in subsequent commits.)
One thing is for sure, addgroup() doesn't belong on imanifestlog -
at least not unless we extend that interface to encompass storage.
For now, let's access addgroup() on the _revlog attribute, just like
we do for tree manifests. Even though this violates visibility,
it is consistent.
Differential Revision: https://phab.mercurial-scm.org/D4274
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 13:59:27 -0700] rev 39240
repository: clarify role of imanifestlog
Looking at the implementation of manifest.manifestlog, it is highly
tailored towards servicing the root manifest. So clarify that in the
interface docstring.
Differential Revision: https://phab.mercurial-scm.org/D4273
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 13:43:26 -0700] rev 39239
changegroup: change topics during generation
Changegroup generation and consumption currently uses different sets of
topics. Generation uses "bundling" and consumption uses the name of the
thing being consumed.
This commit makes the topic and unit names consistent on both ends.
The reason I chose to change the generation side is because when
"bundling" is used for 3 different stages, it is unclear which stage
of changegroup generation we're in. By making the topics "changesets,"
"manifests," and "files," one can get a better feel for how far along
in the bundling process we are.
Differential Revision: https://phab.mercurial-scm.org/D4272
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:44:15 -0700] rev 39238
changegroup: rename mfs to manifests
In the name of readability.
Differential Revision: https://phab.mercurial-scm.org/D4271
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:42:00 -0700] rev 39237
changegroup: clean up changelog callback
changelog.read() calls changelog.changelogrevion() then turns it into
a tuple. Let's call changelogrevision() directly and used named
attributes to make code easier to read.
While we're here, also change some variable names to make code easier
to read.
Differential Revision: https://phab.mercurial-scm.org/D4270