jj/lib/tests
Martin von Zweigbergk 94aec90bee revset: resolve symbols earlier, before passing to revset engine
For large repos, it's useful to be able to use shorter change id and
commit id prefixes by resolving the prefix in a limited subset of the
repo (typically the same subset that you'd want to see in your default
log output). For very large repos, like Google's internal one, the
shortest unique prefix evaluated within the whole repo is practically
useless because it's long enough that the user would want to copy and
paste it anyway.

Mercurial supports this with its `revisions.disambiguatewithin` config
(added in https://www.mercurial-scm.org/repo/hg/rev/503f936489dd). I'd
like to add the same feature to jj. Mercurial's implementation works
by attempting to resolve the prefix in the whole repo and then, if the
prefix was ambiguous, it resolves it in the configured subset
instead. The advantage of doing it that way is that there's no extra
cost of resolving the revset defining the subset if the prefix was not
ambiguous within the whole repo. However, there are two important
reasons to do it differently in jj:

* We support very large repos using custom backends, and it's probably
  cheaper to resolve a prefix within the subset because it can all be
  cached on the client. Resolving the prefix within the whole repo
  requires a roundtrip to the server.

* We want to be able to resolve change id prefixes, which is always
  done in *some* revset. That revset is currently `all()`, i.e. all
  visible commits. Even on local disk, it's probably cheaper to
  resolve a small revset first and then resolve the prefix within that
  than it is to build up the index of all visible change ids.

We could achieve the goal by letting each revset engine respect the
configured subset, but since the solution proposed above makes sense
also for local-disk repos, I think it's better to do it outside of the
revset engine, so all revset engines can share the code.

This commit prepares for the new functionality by moving the symbol
resolution out of `Index::evaluate_revset()`.
2023-03-17 22:42:41 -07:00
..
test_bad_locking.rs repo: replace load_at_head() by helper in tests 2023-02-27 09:44:28 -08:00
test_commit_builder.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00
test_commit_concurrent.rs repo: replace load_at_head() by helper in tests 2023-02-27 09:44:28 -08:00
test_conflicts.rs conflicts: fix off-by-one error in materialize_merge_result() 2023-02-24 19:58:10 +09:00
test_diff_summary.rs matchers: simplify FilesMatcher::new() to take slice of paths 2022-12-30 14:15:27 +09:00
test_git.rs index: load store based on type recorded in .jj/repo/index/type 2023-03-11 22:22:46 -08:00
test_index.rs tests: call num_commits() on specific implementation 2023-03-12 22:08:31 -07:00
test_init.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00
test_load_repo.rs repo: propagate error when failing to look up backend type 2023-02-27 09:44:28 -08:00
test_merge_trees.rs backend: rename ConflictPart to ConflictTerm 2023-02-17 23:28:50 -08:00
test_mut_repo.rs tests: avoid some unnecessary calls to index().stats() 2023-03-12 22:08:31 -07:00
test_operations.rs repo: replace RepoRef by Repo trait 2023-02-15 19:15:17 -08:00
test_refs.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00
test_revset.rs revset: resolve symbols earlier, before passing to revset engine 2023-03-17 22:42:41 -07:00
test_revset_graph_iterator.rs revset: add default_ prefix to graph iterator module 2023-03-14 05:32:02 -07:00
test_rewrite.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00
test_view.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00
test_working_copy.rs backend: rename ConflictPart to ConflictTerm 2023-02-17 23:28:50 -08:00
test_working_copy_concurrent.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00
test_working_copy_sparse.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00
test_workspace.rs repo: extract a Repo trait for Arc<ReadonlyRepo> and MutableRepo 2023-02-15 19:15:17 -08:00