From 91ee32b183ccd83c6139f26784e7d947266853ca Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 4 Nov 2022 22:34:24 -0700 Subject: [PATCH] templater: drop support for `open` template keyword --- src/formatter.rs | 5 ----- src/template_parser.rs | 6 ++---- src/templater.rs | 8 -------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/formatter.rs b/src/formatter.rs index dbf31f1c7..a8fa5c694 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -140,7 +140,6 @@ fn config_colors(user_settings: &UserSettings) -> HashMap { 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::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"), diff --git a/src/template_parser.rs b/src/template_parser.rs index 436856c60..bf847eb73 100644 --- a/src/template_parser.rs +++ b/src/template_parser.rs @@ -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, diff --git a/src/templater.rs b/src/templater.rs index 5523406ee..8e6920b25 100644 --- a/src/templater.rs +++ b/src/templater.rs @@ -196,14 +196,6 @@ impl TemplateProperty for CommitterProperty { } } -pub struct OpenProperty; - -impl TemplateProperty for OpenProperty { - fn extract(&self, context: &Commit) -> bool { - context.is_open() - } -} - pub struct WorkingCopiesProperty<'a> { pub repo: RepoRef<'a>, }