Augie Fackler <augie@google.com> [Tue, 10 Sep 2019 09:42:56 -0400] rev 42932
idirstate: remove now non-public _map attribute
Differential Revision: https://phab.mercurial-scm.org/D6838
Augie Fackler <augie@google.com> [Tue, 10 Sep 2019 09:21:38 -0400] rev 42931
interfaces: introduce an interface for dirstate implementations
As usual with adding interface definitions, this describes the way
things are, not the way we'd like things to be. There are some clear
problems in the interface right now (eg ._map leaks in a few places),
but I have plans to clean those up. There are also many missing
docstrings, but again, we'll make a second pass to clean that up.
Differential Revision: https://phab.mercurial-scm.org/D6836
Augie Fackler <augie@google.com> [Tue, 10 Sep 2019 09:41:58 -0400] rev 42930
cleanup: fix leakage of dirstate._map to client code
We already had proper accessors for most of the behavior of
dirstate._map that callers cared about exposed in the actual dirstate
class as public methods. Sigh.
There are two remaining privacy violations in the codebase after this change:
1) In the perf extension, which I suspect has to stick around because
it's really testing the dirstate implementation directly
2) In largefiles, where we deal with standins and mutating status. Looking at
this, I _strongly_ suspect a formal dirstate interface would allow
this to work via composition instead of inheritance and
monkeypatching. Fortunately, such wins are a part of my motivation
for this work. I anticipate we'll come back to this in due time.
Differential Revision: https://phab.mercurial-scm.org/D6837
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sun, 08 Sep 2019 20:26:36 -0400] rev 42929
exchange: convert bookmark nodes from hex to bin ASAP
Differential Revision: https://phab.mercurial-scm.org/D6831
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sun, 08 Sep 2019 20:10:32 -0400] rev 42928
exchange: avoid unnecessary conversion of bookmark nodes to hex (API)
Differential Revision: https://phab.mercurial-scm.org/D6830
Connor Sheehan <sheehan@mozilla.com> [Mon, 09 Sep 2019 14:26:43 -0400] rev 42927
highlight: fix encoding issues to enable Py3 compatibility
This commit fixes various encoding issues with the `highlight` extension
to enable compatibility with Python 3. Python `.encode()` and `.decode()`
requires the target encoding to be passed as a `str`, so the value of
`mercurial.encoding.encoding` must be converted before passing to the
function. Pygments also assumes the `str` type for values it works with,
so we must perform conversions before and after receiving values from its
APIs.
After applying this patch, `test-highlight.t` passes under Python 3. We
add it to `python3-whitelist` as well.
Tested with Pygments 2.4.2.
Differential Revision: https://phab.mercurial-scm.org/D6832
Connor Sheehan <sheehan@mozilla.com> [Tue, 10 Sep 2019 12:32:07 -0400] rev 42926
hgweb: add a `message` attribute to `hgweb.common.ErrorResponse`
This fixes a Python 3 bug where hgweb assumes an Exception
subclass will have a `.message` attribute after running
`Exception.__init__`.[1] The Python 3 way to get this info would
be `e.args[0]`, but adding a new named attribute is more
ergonomic in my view.
[1] https://www.mercurial-scm.org/repo/hg-committed/file/6ccf539aec71/mercurial/hgweb/hgwebdir_mod.py#l459
Differential Revision: https://phab.mercurial-scm.org/D6840