py3: change default priority and length used for sorting hooks to be compatible with python 3
The call to `sorted(hooks.values())` can on line 213 of hooks.py can raise when using
python 3. For instance, when hooks.values is `[(0, 2, b'post-commit.check-status', b''),
(None, None, b'changegroup.app-hooks', <object object at 0x
7f5279885590>)]`, the error is
`TypeError: '<' not supported between instances of 'NoneType' and 'int'`
This fix keeps the same order that was used in python 2 without relying on comparison with
None.
Differential Revision: https://phab.mercurial-scm.org/D8527
relnotes: copy "next" to "5.4" and clear "next"
This is the same thing as we've done for the previous few releases.
Differential Revision: https://phab.mercurial-scm.org/D8546
dirstate: make sure the dirstate is loaded before the changelog (
issue6303)
Before this change, it was possible for the changelog to be loaded before the
dirstate. If a transaction happens betwen the changelog and dirstate reading,
the dirstate can up end poitning toward a revision not existing in the (olded)
changelog. This lead to a warning.
With this revision, we preload the dirstate parent before reading the changelog.
This has a negligible performance impact on performance for all case we are
tracking.
Differential Revision: https://phab.mercurial-scm.org/D8528
rust-dirstatemap: don't read the dirstate when requesting parents
A future patch for issue 6303 reveals a big performance regression in the Rust
`DirstateMap` that reads the entire dirstate when requesting parents instead
of the first 40 bytes.
`perfdiscovery` gets a *significant* speedup (from 0.101 to 0.016) when applied
against said patch.
I'm assuming it has other performance benefits, but this is already a good
enough win.
Differential Revision: https://phab.mercurial-scm.org/D8513
py3: fix exception in pull when several things happen to a bookmark
Specifically, when `changes` is:
[(b'@upstream-committed', None, <function ui.status>, b'updating bookmark @upstream-committed\n'),
(b'@upstream-committed', binary-node, <function ui.warn>, b'divergent bookmark @ stored as @upstream-committed\n')]
sorting the list raises:
TypeError: '<' not supported between instances of 'bytes' and 'NoneType'
Differential Revision: https://phab.mercurial-scm.org/D8523
cleanup: avoid extra node/ctx conversions in logcmdutil.diffordiffstat
I'm about to write some code that wants to pass a memctx to
diffordiffstat, but this feels like a meritorious cleanup anyway,
since the first thing this method does is turn nodes into contexts,
and most callers have a context handy.
Differential Revision: https://phab.mercurial-scm.org/D8502
pyoxidizer: formatting bazel definitions
This meets the Bazel style guide:
https://docs.bazel.build/versions/master/skylark/bzl-style.html
and was mostly done automatically with buildifier.
Differential Revision: https://phab.mercurial-scm.org/D8521
fastexport: adjust output to be more canonical
For time zones, git doesn't consider +0 and -0 the same timezone, so use
the former canonically. Add a test case to ensure that non-UTC offsets
are handled correctly. The real name part of the committer name is
normally not quoted, so don't enforce that.
Differential Revision: https://phab.mercurial-scm.org/D8522