forked from mirrors/jj
template: add method mine() to commit type
This commit is contained in:
parent
361b4ca425
commit
479c3245f4
1 changed files with 6 additions and 0 deletions
|
@ -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| {
|
||||
|
|
Loading…
Reference in a new issue