templater: drop support for open template keyword

This commit is contained in:
Martin von Zweigbergk 2022-11-04 22:34:24 -07:00 committed by Martin von Zweigbergk
parent 6320f24360
commit 91ee32b183
3 changed files with 2 additions and 17 deletions

View File

@ -140,7 +140,6 @@ fn config_colors(user_settings: &UserSettings) -> HashMap<String, String> {
result.insert(String::from("hint"), String::from("blue"));
result.insert(String::from("commit_id"), String::from("blue"));
result.insert(String::from("commit_id open"), String::from("green"));
result.insert(String::from("change_id"), String::from("magenta"));
result.insert(String::from("author"), String::from("yellow"));
result.insert(String::from("author timestamp"), String::from("cyan"));
@ -163,10 +162,6 @@ fn config_colors(user_settings: &UserSettings) -> HashMap<String, String> {
String::from("working_copy commit_id"),
String::from("bright blue"),
);
result.insert(
String::from("working_copy commit_id open"),
String::from("bright green"),
);
result.insert(
String::from("working_copy change_id"),
String::from("bright magenta"),

View File

@ -26,9 +26,8 @@ use crate::templater::{
AuthorProperty, BranchProperty, ChangeIdProperty, CommitIdKeyword, CommitterProperty,
ConditionalTemplate, ConflictProperty, ConstantTemplateProperty, DescriptionProperty,
DivergentProperty, DynamicLabelTemplate, GitRefsProperty, IsGitHeadProperty,
IsWorkingCopyProperty, LabelTemplate, ListTemplate, LiteralTemplate, OpenProperty,
StringPropertyTemplate, TagProperty, Template, TemplateFunction, TemplateProperty,
WorkingCopiesProperty,
IsWorkingCopyProperty, LabelTemplate, ListTemplate, LiteralTemplate, StringPropertyTemplate,
TagProperty, Template, TemplateFunction, TemplateProperty, WorkingCopiesProperty,
};
#[derive(Parser)]
@ -242,7 +241,6 @@ fn parse_commit_keyword<'a>(
"commit_id" => Property::CommitId(Box::new(CommitIdKeyword)),
"author" => Property::Signature(Box::new(AuthorProperty)),
"committer" => Property::Signature(Box::new(CommitterProperty)),
"open" => Property::Boolean(Box::new(OpenProperty)),
"working_copies" => Property::String(Box::new(WorkingCopiesProperty { repo })),
"current_working_copy" => Property::Boolean(Box::new(IsWorkingCopyProperty {
repo,

View File

@ -196,14 +196,6 @@ impl TemplateProperty<Commit, Signature> for CommitterProperty {
}
}
pub struct OpenProperty;
impl TemplateProperty<Commit, bool> for OpenProperty {
fn extract(&self, context: &Commit) -> bool {
context.is_open()
}
}
pub struct WorkingCopiesProperty<'a> {
pub repo: RepoRef<'a>,
}