From 479c3245f431601112811b27a1910b513eb7f933 Mon Sep 17 00:00:00 2001 From: Noah Mayr Date: Thu, 4 Apr 2024 17:43:59 +0200 Subject: [PATCH] template: add method mine() to commit type --- cli/src/commit_templater.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/src/commit_templater.rs b/cli/src/commit_templater.rs index ca65f19b1..17c321f96 100644 --- a/cli/src/commit_templater.rs +++ b/cli/src/commit_templater.rs @@ -458,6 +458,12 @@ fn builtin_commit_methods<'repo>() -> CommitTemplateBuildMethodFnMap<'repo, Comm Ok(L::wrap_signature(out_property)) }, ); + map.insert("mine", |language, _build_ctx, self_property, function| { + template_parser::expect_no_arguments(function)?; + let user_email = language.revset_parse_context.user_email.clone(); + let out_property = self_property.map(move |commit| commit.author().email == user_email); + Ok(L::wrap_boolean(out_property)) + }); map.insert( "working_copies", |language, _build_ctx, self_property, function| {