fuzz: don't allow enormous revlog inputs either
I'm about to make the fuzzer do more, and without this it was getting
enthusiastic about large (and therefore slow) inputs that I don't
think buy us much.
Differential Revision: https://phab.mercurial-scm.org/D5640
ui: remove unreachable branches and function calls from write() (
issue6059)
This is at least faster than ui.write() of 4.8.2.
$ HGRCPATH=/dev/null hg files -R mozilla-central --time >/dev/null
4.8.2: time: real 2.340 secs (user 2.310+0.000 sys 0.020+0.000)
4.9rc0: time: real 2.580 secs (user 2.550+0.000 sys 0.020+0.000)
this: time: real 2.230 secs (user 2.210+0.000 sys 0.020+0.000)
Maybe the formatter should own a resolved write() function because it will
just call dest.write(msg) most of the time, but that would be too much for
stable.
ui: inline _writenobuf() into write() due to performance issue
I'll remove redundant conditions later in this series.
ui: inline _write() into write() due to performance issue
I'll remove redundant conditions later in this series.
ui: optimize buffered write with no label
This was spotted while making fastannotate faster again after ditching its
own formatter. Since I'm going to inline _write() into ui.write(), I decided
to include this patch in this series.
Here, the cost of '(self.label(a, label) for a in args)' was significant
in hot loops.
partialdiscovery: avoid `undecided` related computation sooner than necessary
Changeset
1d30be90c move the update of the `undecided` set within the
`partialdiscovery` object in order to clarify the API.
The update to the `undecided` set was unconditional in
1d30be90c and the first
access to the `self.undecided` property triggered the initial computation of
the set of undecided revisions. As a result, the set was computed much
earlier, at a time where less information is available, immediately followed
by an update of this set to remove common revisions.
To fix this regression, we ignore the `undecided` related logic in
`addcommons` when that `undecided` set has not been computed yet. Code that
actually needs to know the `undecided` set will trigger its computation later.
The change has no effects on semantic because the initial computation
`undecided` set takes all knowns `common` into account.
Example performance running `hg debugdiscovery` from a pypy repo missing 10
changesets:
870a89c6909d: 52.3ms (regression parent)
1d30be90c9dc: 72.0ms (regression)
5a5f504a7175: 64.8ms (this fix parent)
this fix: 52.6ms
revlog: fix resolution of revlog version 0
This partially backs out
cecf3f8bccd3, "revlog: always process opener options."
My understanding is that if there's no "revlog1" nor "revlog2" in .hg/requires,
the repository should stick to the v0 format. The reasoning is briefly
described in
31a5973fcf96, "revlog: get rid of defversion."
Maybe we can drop support for missing opener options, but I didn't do that
in this patch.
rust: add comment about lack of wdirrev handling
If hg is compiled with rust support, 'only(wdir())' crashed as
"rustext.GraphError: ('ParentOutOfRange',
2147483647)", which should instead
say "abort: working directory revision cannot be specified."
templatekw: fix crash on multiple latesttags resolution at wdir (
issue6055)
It appears not easy to fix only() to support wdir(), so this patch works
around the issue by getlatesttags(). The "+1" after len(changes) doesn't
matter since ctx never changes while sorting. It's just for clarity.