relnotes/5.5
author Manuel Jacob <me@manueljacob.de>
Mon, 11 Jul 2022 01:51:20 +0200
branchstable
changeset 49378 094a5fa3cf52
parent 45240 53a6febafc66
permissions -rw-r--r--
procutil: make stream detection in make_line_buffered more correct and strict In make_line_buffered(), we don’t want to wrap the stream if we know that lines get flushed to the underlying raw stream already. Previously, the heuristic was too optimistic. It assumed that any stream which is not an instance of io.BufferedIOBase doesn’t need wrapping. However, there are buffered streams that aren’t instances of io.BufferedIOBase, like Mercurial’s own winstdout. The new logic is different in two ways: First, only for the check, if unwraps any combination of WriteAllWrapper and winstdout. Second, it skips wrapping the stream only if it is an instance of io.RawIOBase (or already wrapped). If it is an instance of io.BufferedIOBase, it gets wrapped. In any other case, the function raises an exception. This ensures that, if an unknown stream is passed or we add another wrapper in the future, we don’t wrap the stream if it’s already line buffered or not wrap the stream if it’s not line buffered. In fact, this was already helpful during development of this change. Without it, I possibly would have forgot that WriteAllWrapper needs to be ignored for the check, leading to unnecessary wrapping if stdout is unbuffered. The alternative would have been to always wrap unknown streams. However, I don’t think that anyone would benefit from being less strict. We can expect streams from the standard library to be subclassing either io.RawIOBase or io.BufferedIOBase, so running Mercurial in the standard way should not regress by this change. Py2exe might replace sys.stdout and sys.stderr, but that currently breaks Mercurial anyway and also these streams don’t claim to be interactive, so this function is not called for them.

== New Features ==

 * clonebundles can be annotated with the expected memory requirements
   using the `REQUIREDRAM` option. This allows clients to skip
   bundles created with large zstd windows and fallback to larger, but
   less demanding bundles.

 * The `phabricator` extension now provides more functionality of the
   arcanist CLI like changing the status of a differential.

 * Phases processing is much faster, especially for repositories with
   old non-public changesets.


== New Experimental Features ==

 * The core of some hg operations have been (and are being)
   implemented in rust, for speed. `hg status` on a repository with
   300k tracked files goes from 1.8s to 0.6s for instance.
   This has currently been tested only on linux, and does not build on
   windows. See rust/README.rst in the mercurial repository for
   instructions to opt into this.

 * An experimental config `rewrite.empty-successor` was introduced to control
   what happens when rewrite operations result in empty changesets.


== Bug Fixes ==

 * For the case when connected to a TTY, stdout was fixed to be line-buffered
   on Python 3 (where it was block-buffered before, causing the process to seem
   hanging) and Windows on Python 2 (where it was unbuffered before).

 * Subversion sources of the convert extension were fixed to work on Python 3.

 * Subversion sources of the convert extension now interpret the encoding of
   URLs like Subversion. Previously, there were situations where the convert
   extension recognized a repository as present but Subversion did not, and
   vice versa.

 * The empty changeset check of in-memory rebases was fixed to match that of
   normal rebases (and that of the commit command).

 * The push command now checks the correct set of outgoing changesets for
   obsolete and unstable changesets. Previously, it could happen that the check
   prevented pushing changesets which were already on the server.


== Backwards Compatibility Changes ==

 * Mercurial now requires at least Python 2.7.9 or a Python version that
   backported modern SSL/TLS features (as defined in PEP 466), and that Python
   was compiled against a OpenSSL version supporting TLS 1.1 or TLS 1.2
   (likely this requires the OpenSSL version to be at least 1.0.1).
 
 * The `hg perfwrite` command from contrib/perf.py was made more flexible and
   changed its default behavior. To get the previous behavior, run `hg perfwrite
   --nlines=100000 --nitems=1 --item='Testing write performance' --batch-line`.

 * The absorb extension now preserves changesets with no file changes that can
   be created by the commit command (those which change the branch name
   compared to the parent and those closing a branch head).


== Internal API Changes ==

 * logcmdutil.diffordiffstat() now takes contexts instead of nodes.

 * The `mergestate` class along with some related methods and constants have
   moved from `mercurial.merge` to a new `mercurial.mergestate` module.

 * The `phasecache` class now uses sparse dictionaries for the phase data.
   New accessors are provided to detect if any non-public changeset exists
   (`hasnonpublicphases`) and get the correponsponding root set
   (`nonpublicphaseroots`).

 * The `stdin`, `stdout` and `stderr` attributes of the `mercurial.pycompat`
   module were removed. Instead, the attributes of same name from the
   `mercurial.utils.procutil` module should be used, which provide more
   consistent behavior across Python versions and platforms.