From 7e1b1d7324c9a5c39738fae4ac14a78ced608d65 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 18 Aug 2023 14:13:32 +0800 Subject: [PATCH] feature: add button to use selected revision of file --- src/Commands/Checkout.cs | 5 +++++ src/Resources/Locales/en_US.xaml | 1 + src/Resources/Locales/zh_CN.xaml | 1 + src/Views/FileHistories.xaml | 19 ++++++++++++++++++- src/Views/FileHistories.xaml.cs | 19 +++++++++++++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/Commands/Checkout.cs b/src/Commands/Checkout.cs index dbab4947..1f169992 100644 --- a/src/Commands/Checkout.cs +++ b/src/Commands/Checkout.cs @@ -37,6 +37,11 @@ namespace SourceGit.Commands { return Exec(); } + public bool FileWithRevision(string file, string revision) { + Args = $"checkout {revision} -- \"{file}\""; + return Exec(); + } + public bool Files(List files) { StringBuilder builder = new StringBuilder(); builder.Append("checkout -f -q --"); diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml index 854913f1..da900303 100644 --- a/src/Resources/Locales/en_US.xaml +++ b/src/Resources/Locales/en_US.xaml @@ -259,6 +259,7 @@ Prune remote dead branches File History + USE THIS VERSION CHANGE DISPLAY MODE Show as Grid diff --git a/src/Resources/Locales/zh_CN.xaml b/src/Resources/Locales/zh_CN.xaml index 9adfbe56..9eafebf9 100644 --- a/src/Resources/Locales/zh_CN.xaml +++ b/src/Resources/Locales/zh_CN.xaml @@ -258,6 +258,7 @@ 自动清理远程已删除分支 文件历史 + 使用该版本 切换变更显示模式 网格模式 diff --git a/src/Views/FileHistories.xaml b/src/Views/FileHistories.xaml index ad2a461a..27aa7ac3 100644 --- a/src/Views/FileHistories.xaml +++ b/src/Views/FileHistories.xaml @@ -131,7 +131,24 @@ - + + + + + + + + +