From 6d8420e8e670eab1f26c52ae74fd938dbaa740dc Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Mon, 18 Mar 2024 21:48:22 +0900 Subject: [PATCH] cli: extract function that creates CommitTemplateLanguage for the workspace cmd_log() will parse the text and graph node templates by using the shared language environment. --- cli/src/cli_util.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 0de83c16fd..4b005fd106 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -912,15 +912,20 @@ Set which revision the branch points to with `jj branch set {branch_name} -r Result, CommandError> { + Ok(CommitTemplateLanguage::new( self.repo().as_ref(), self.workspace_id(), self.revset_parse_context(), self.id_prefix_context()?, self.commit_template_extension.as_deref(), - ); - let inner_template = self.parse_template(&language, template_text)?; - Ok(Box::new(TemplateWrapper(inner_template))) + )) } /// Template for one-line summary of a commit.