forked from mirrors/jj
0bc1341fd0
The count() function in this trait is used by "jj branch" to determine (and then report) how many commits a certain branch is ahead/behind another branch. This is currently implemented by walking all commits in the revset, counting how many were encountered. But this could be improved: if the number is large, it is probably sufficient to report "at least N" (instead of walking all the way), and this does not scale well to jj backends that may not have all commits present locally (which may prefer to return an estimate, rather than access the network). Therefore, add a function that is explicitly documented to be O(1) and that can return a range of values if the backend so chooses. Also remove count(), as it is not immediately obvious that it is an expensive call, and callers that are willing to pay the cost can obtain the exact same functionality through iter().count() anyway. (In this commit, all users of count() are migrated to iter().count() to preserve all existing functionality; they will be migrated to count_estimate() in a subsequent commit.) "branch" needed to be updated due to this change. Although jj is currently only available in English, I have attempted to keep user-visible text from being assembled piece by piece, so that if we later decide to translate jj into other languages, things will be easier for translators.
94 lines
2.7 KiB
TOML
94 lines
2.7 KiB
TOML
[package]
|
|
name = "jj-cli"
|
|
description = "Jujutsu - an experimental version control system"
|
|
default-run = "jj"
|
|
|
|
version = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
license = { workspace = true }
|
|
homepage = { workspace = true }
|
|
repository = { workspace = true }
|
|
documentation = { workspace = true }
|
|
keywords = { workspace = true }
|
|
|
|
[[bin]]
|
|
name = "jj"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "fake-editor"
|
|
path = "testing/fake-editor.rs"
|
|
required-features = ["test-fakes"]
|
|
|
|
[[bin]]
|
|
name = "fake-diff-editor"
|
|
path = "testing/fake-diff-editor.rs"
|
|
required-features = ["test-fakes"]
|
|
|
|
[build-dependencies]
|
|
cargo_metadata = { workspace = true }
|
|
|
|
[dependencies]
|
|
chrono = { workspace = true }
|
|
clap = { workspace = true }
|
|
clap_complete = { workspace = true }
|
|
clap_mangen = { workspace = true }
|
|
config = { workspace = true }
|
|
criterion = { workspace = true, optional = true }
|
|
crossterm = { workspace = true }
|
|
dirs = { workspace = true }
|
|
esl01-renderdag = { workspace = true }
|
|
futures = { workspace = true }
|
|
git2 = { workspace = true }
|
|
gix = { workspace = true }
|
|
hex = { workspace = true }
|
|
indexmap = { workspace = true }
|
|
itertools = { workspace = true }
|
|
jj-lib = { workspace = true }
|
|
maplit = { workspace = true }
|
|
once_cell = { workspace = true }
|
|
pest = { workspace = true }
|
|
pest_derive = { workspace = true }
|
|
pollster = { workspace = true }
|
|
regex = { workspace = true }
|
|
rpassword = { workspace = true }
|
|
scm-record = { workspace = true }
|
|
serde = { workspace = true }
|
|
slab = { workspace = true }
|
|
tempfile = { workspace = true }
|
|
textwrap = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
timeago = { workspace = true }
|
|
toml_edit = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-chrome = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
unicode-width = { workspace = true }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
anyhow = { workspace = true }
|
|
assert_cmd = { workspace = true }
|
|
assert_matches = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
insta = { workspace = true }
|
|
test-case = { workspace = true }
|
|
testutils = { workspace = true }
|
|
# https://github.com/rust-lang/cargo/issues/2911#issuecomment-1483256987
|
|
jj-cli = { path = ".", features = ["test-fakes"], default-features = false }
|
|
|
|
[features]
|
|
default = ["watchman"]
|
|
bench = ["dep:criterion"]
|
|
packaging = []
|
|
test-fakes = ["jj-lib/testing"]
|
|
vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"]
|
|
watchman = ["jj-lib/watchman"]
|
|
|
|
[package.metadata.binstall]
|
|
# The archive name is jj, not jj-cli. Also, `cargo binstall` gets
|
|
# confused by the `v` before versions in archive name.
|
|
pkg-url = "{ repo }/releases/download/v{ version }/jj-v{ version }-{ target }.{ archive-format }"
|