jj/lib/Cargo.toml
Jonathan Tan 0bc1341fd0 revset: add count_estimate() to Revset trait
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.
2024-01-22 15:07:00 -08:00

78 lines
2.1 KiB
TOML

[package]
name = "jj-lib"
description = "Library for Jujutsu - an experimental version control system"
version = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
documentation = { workspace = true }
readme = { workspace = true }
[[bench]]
name = "diff_bench"
harness = false
[build-dependencies]
version_check = { workspace = true }
[dependencies]
async-trait = { workspace = true }
backoff = { workspace = true }
blake2 = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true }
config = { workspace = true }
digest = { workspace = true }
either = { workspace = true }
futures = { workspace = true }
git2 = { workspace = true }
gix = { workspace = true }
glob = { workspace = true }
hex = { workspace = true }
itertools = { workspace = true }
maplit = { workspace = true }
once_cell = { workspace = true }
pest = { workspace = true }
pest_derive = { workspace = true }
pollster = { workspace = true }
prost = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
rayon = { workspace = true }
ref-cast = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
smallvec = { workspace = true }
strsim = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, optional = true }
tracing = { workspace = true }
watchman_client = { workspace = true, optional = true }
whoami = { workspace = true }
zstd = { workspace = true }
[target.'cfg(unix)'.dependencies]
rustix = { workspace = true }
[dev-dependencies]
assert_matches = { workspace = true }
criterion = { workspace = true }
esl01-renderdag = { workspace = true }
insta = { workspace = true }
num_cpus = { workspace = true }
pretty_assertions = { workspace = true }
test-case = { workspace = true }
testutils = { workspace = true }
tokio = { workspace = true, features = ["full"] }
[features]
default = []
vendored-openssl = ["git2/vendored-openssl"]
watchman = ["dep:tokio", "dep:watchman_client"]
testing = []