rust/rhg/Cargo.toml
author Manuel Jacob <me@manueljacob.de>
Mon, 11 Jul 2022 01:51:20 +0200
branchstable
changeset 49378 094a5fa3cf52
parent 49164 a932cad26d37
child 49517 52464a20add0
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44981
cf04f62d1579 rhg: add rhg crate
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
     1
[package]
cf04f62d1579 rhg: add rhg crate
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
     2
name = "rhg"
cf04f62d1579 rhg: add rhg crate
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
     3
version = "0.1.0"
45984
fada33872b5b rhg: use `format_bytes!` for error messages
Raphaël Gomès <rgomes@octobus.net>
parents: 45530
diff changeset
     4
authors = [
fada33872b5b rhg: use `format_bytes!` for error messages
Raphaël Gomès <rgomes@octobus.net>
parents: 45530
diff changeset
     5
    "Antoine Cezar <antoine.cezar@octobus.net>",
fada33872b5b rhg: use `format_bytes!` for error messages
Raphaël Gomès <rgomes@octobus.net>
parents: 45530
diff changeset
     6
    "Raphaël Gomès <raphael.gomes@octobus.net>",
fada33872b5b rhg: use `format_bytes!` for error messages
Raphaël Gomès <rgomes@octobus.net>
parents: 45530
diff changeset
     7
]
44981
cf04f62d1579 rhg: add rhg crate
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
     8
edition = "2018"
cf04f62d1579 rhg: add rhg crate
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
     9
cf04f62d1579 rhg: add rhg crate
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
    10
[dependencies]
48952
8848c3453661 rhg: upgrade dependencies
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    11
atty = "0.2.14"
45049
513b3ef277a3 rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents: 44981
diff changeset
    12
hg-core = { path = "../hg-core"}
46601
755c31a1caf9 rhg: Add support for the blackbox extension
Simon Sapin <simon.sapin@octobus.net>
parents: 46499
diff changeset
    13
chrono = "0.4.19"
48952
8848c3453661 rhg: upgrade dependencies
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    14
clap = "2.34.0"
8848c3453661 rhg: upgrade dependencies
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    15
derive_more = "0.99.17"
47404
ebdef6283798 rhg: read [paths] for `--repository` value
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46733
diff changeset
    16
home = "0.5.3"
46729
6cd9f53aaed8 rhg: Fall back to Python on --repository with an URL
Simon Sapin <simon.sapin@octobus.net>
parents: 46601
diff changeset
    17
lazy_static = "1.4.0"
48952
8848c3453661 rhg: upgrade dependencies
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    18
log = "0.4.14"
8848c3453661 rhg: upgrade dependencies
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    19
micro-timer = "0.4.0"
8848c3453661 rhg: upgrade dependencies
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    20
regex = "1.5.5"
8848c3453661 rhg: upgrade dependencies
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    21
env_logger = "0.9.0"
48492
d3ec82016104 rust: Upgrade to format-bytes 0.3
Simon Sapin <simon.sapin@octobus.net>
parents: 47404
diff changeset
    22
format-bytes = "0.3.0"
46601
755c31a1caf9 rhg: Add support for the blackbox extension
Simon Sapin <simon.sapin@octobus.net>
parents: 46499
diff changeset
    23
users = "0.11.0"
49149
006688e36e12 rhg: use `Command::exec` instead of `Command::status`
Raphaël Gomès <rgomes@octobus.net>
parents: 48733
diff changeset
    24
which = "4.2.5"