mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 14:57:14 +00:00
revset: move resolve_symbol() to tests
It's no longer used in library code.
This commit is contained in:
parent
916b00c33e
commit
f58beca760
2 changed files with 12 additions and 11 deletions
|
@ -1770,14 +1770,6 @@ impl SymbolResolver for DefaultSymbolResolver<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn resolve_symbol(
|
||||
repo: &dyn Repo,
|
||||
symbol: &str,
|
||||
workspace_id: Option<&WorkspaceId>,
|
||||
) -> Result<Vec<CommitId>, RevsetResolutionError> {
|
||||
DefaultSymbolResolver::new(repo, workspace_id).resolve_symbol(symbol)
|
||||
}
|
||||
|
||||
fn resolve_commit_ref(
|
||||
repo: &dyn Repo,
|
||||
commit_ref: &RevsetCommitRef,
|
||||
|
|
|
@ -24,9 +24,9 @@ use jujutsu_lib::op_store::{RefTarget, WorkspaceId};
|
|||
use jujutsu_lib::repo::Repo;
|
||||
use jujutsu_lib::repo_path::RepoPath;
|
||||
use jujutsu_lib::revset::{
|
||||
optimize, parse, resolve_symbol, DefaultSymbolResolver, ReverseRevsetGraphIterator, Revset,
|
||||
RevsetAliasesMap, RevsetExpression, RevsetFilterPredicate, RevsetGraphEdge,
|
||||
RevsetResolutionError, RevsetWorkspaceContext,
|
||||
optimize, parse, DefaultSymbolResolver, ReverseRevsetGraphIterator, Revset, RevsetAliasesMap,
|
||||
RevsetExpression, RevsetFilterPredicate, RevsetGraphEdge, RevsetResolutionError,
|
||||
RevsetWorkspaceContext, SymbolResolver as _,
|
||||
};
|
||||
use jujutsu_lib::settings::GitSettings;
|
||||
use jujutsu_lib::tree::merge_trees;
|
||||
|
@ -36,6 +36,14 @@ use testutils::{
|
|||
create_random_commit, write_random_commit, CommitGraphBuilder, TestRepo, TestWorkspace,
|
||||
};
|
||||
|
||||
fn resolve_symbol(
|
||||
repo: &dyn Repo,
|
||||
symbol: &str,
|
||||
workspace_id: Option<&WorkspaceId>,
|
||||
) -> Result<Vec<CommitId>, RevsetResolutionError> {
|
||||
DefaultSymbolResolver::new(repo, workspace_id).resolve_symbol(symbol)
|
||||
}
|
||||
|
||||
fn revset_for_commits<'index>(
|
||||
repo: &'index dyn Repo,
|
||||
commits: &[&Commit],
|
||||
|
@ -47,6 +55,7 @@ fn revset_for_commits<'index>(
|
|||
.evaluate(repo)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
#[test_case(false ; "local backend")]
|
||||
#[test_case(true ; "git backend")]
|
||||
fn test_resolve_symbol_root(use_git: bool) {
|
||||
|
|
Loading…
Reference in a new issue