revlog: replace descendant(b, a) by isdescendantrev(a, b) (API)
The "is" is to match "isancestor" and to make it clear that it doesn't
return a descendant. The "rev" is to make it clear that it's not about
nodeids (unlike e.g. isancestor()). The argument order change is just
seems more natural (and makes isancestor() less confusing).
Differential Revision: https://phab.mercurial-scm.org/D3929
revlog: move comment about commonancestorsheads where it's used
Differential Revision: https://phab.mercurial-scm.org/D3928
removeemptydirs: add test for `hg split` inside a disappearing directory
Differential Revision: https://phab.mercurial-scm.org/D3927
fncache: avoid loading the filename cache when not actually modifying it
With time, fncache can become very large. The mozilla-central repo for example,
has a 31M and growing fncache file. Loading this file takes time (280ms for the
mozilla-central repository).
In many scenarios, we don't need to load fncache at all. For example, when
committing changes to existing files, or pushing such commits to another clone.
This patch detects when a name is added via store.vfs(), and only loads the
cache if a) the data metadata file doesn't already exist, or b) when opening
for appending, the data or metadata file exists but has size (a transaction
rollback leaves behind such files).
Benchmarks (run on Macos 10.13 on a 2017-model Macbook Pro with Core i7 2.9GHz
and flash drive), each test without and with patch run 5 times:
* committing to an existing file, against the mozilla-central repository.
Baseline real time average 2.3736, with patch 1.9884.
* unbundling a large changeset consisting *only* of existing-file modifications
(159 revisions, 1050 modifications, mozilla-central
4a250a0e4f29:
beea9ac7d823), into a clone limited to the ancestor revision of
that revset). Baseline real time average 1.5048, with patch 1.3108.
scmutil: fix shortesthexnodeidprefix on Python 3 for 0-prefixed nodes
This fixes test-bookmarks.t on Python 3 (which had regressed.)
Differential Revision: https://phab.mercurial-scm.org/D3926
tests: add missing b prefix in test-context.py
# skip-blame just a b prefix
Differential Revision: https://phab.mercurial-scm.org/D3925
manifest: just duplicate the definition of items as iteritems
The forwarding trick was failing test-check-interfaces on Python
3. Duplicating a line of code is easy enough I'm doing that rather
than try and figure out what's going on in any kind of detail.
Differential Revision: https://phab.mercurial-scm.org/D3924