From f58beca760f44608292c53c9d8917c385c4b613f Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 12 May 2023 16:07:40 +0900 Subject: [PATCH] revset: move resolve_symbol() to tests It's no longer used in library code. --- lib/src/revset.rs | 8 -------- lib/tests/test_revset.rs | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 8e9252aaf..6c53a9005 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -1770,14 +1770,6 @@ impl SymbolResolver for DefaultSymbolResolver<'_> { } } -pub fn resolve_symbol( - repo: &dyn Repo, - symbol: &str, - workspace_id: Option<&WorkspaceId>, -) -> Result, RevsetResolutionError> { - DefaultSymbolResolver::new(repo, workspace_id).resolve_symbol(symbol) -} - fn resolve_commit_ref( repo: &dyn Repo, commit_ref: &RevsetCommitRef, diff --git a/lib/tests/test_revset.rs b/lib/tests/test_revset.rs index a4c72689d..ea389ef0c 100644 --- a/lib/tests/test_revset.rs +++ b/lib/tests/test_revset.rs @@ -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, 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) {