Skip to content

Commit

Permalink
template: add method mine() to commit type
Browse files Browse the repository at this point in the history
  • Loading branch information
noahmayr committed Apr 4, 2024
1 parent 361b4ca commit 479c324
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/src/commit_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down

0 comments on commit 479c324

Please sign in to comment.