From 82320f3494c3079be25c3e47a5f0e0207930c070 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 10:26:34 +0800 Subject: [PATCH 1/2] revert: PR #673 * the `Commands.QueryCommitChildren` takes too much time when executes in a large repo Signed-off-by: leo --- src/Commands/QueryCommitChildren.cs | 34 --------------------------- src/Resources/Locales/en_US.axaml | 1 - src/Resources/Locales/fr_FR.axaml | 1 - src/Resources/Locales/zh_CN.axaml | 1 - src/Resources/Locales/zh_TW.axaml | 1 - src/ViewModels/CommitDetail.cs | 13 ----------- src/Views/CommitBaseInfo.axaml | 36 ++++------------------------- src/Views/CommitBaseInfo.axaml.cs | 9 -------- src/Views/CommitDetail.axaml | 1 - 9 files changed, 4 insertions(+), 93 deletions(-) delete mode 100644 src/Commands/QueryCommitChildren.cs diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs deleted file mode 100644 index 22a44563..00000000 --- a/src/Commands/QueryCommitChildren.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace SourceGit.Commands -{ - public class QueryCommitChildren : Command - { - public QueryCommitChildren(string repo, string sha) - { - WorkingDirectory = repo; - Context = repo; - _sha = sha; - Args = $"rev-list --children --all {sha}^.."; - } - - public string[] Result() - { - var rs = ReadToEnd(); - if (!rs.IsSuccess) - return []; - - int start = rs.StdOut.IndexOf($"\n{_sha}"); - if (start != -1) - { - int end = rs.StdOut.IndexOf('\n', start + 1); - if (end == -1) - end = rs.StdOut.Length; - start = rs.StdOut.IndexOf(' ', start); - if (start != -1 && start < end) - return rs.StdOut.Substring(start + 1, end - start - 1).Split(' ', System.StringSplitOptions.RemoveEmptyEntries); - } - return []; - } - - private string _sha; - } -} diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 302f7cba..3803bd39 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -125,7 +125,6 @@ INFORMATION AUTHOR CHANGED - CHILDREN COMMITTER Check refs that contains this commit COMMIT IS CONTAINED BY diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 88e2a661..043e8f97 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -118,7 +118,6 @@ INFORMATIONS AUTEUR CHANGÉ - ENFANTS COMMITTER Vérifier les références contenant ce commit LE COMMIT EST CONTENU PAR diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 34c8e647..3df54899 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -128,7 +128,6 @@ 基本信息 修改者 变更列表 - 子提交 提交者 查看包含此提交的分支/标签 本提交已被以下分支/标签包含 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index a35abc1c..4dcb31aa 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -128,7 +128,6 @@ 基本資訊 作者 變更列表 - 子提交 提交者 檢視包含此提交的分支或標籤 本提交包含於以下分支或標籤 diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index d180f6d6..e56ea3fd 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -78,12 +78,6 @@ namespace SourceGit.ViewModels } } - public AvaloniaList Children - { - get; - private set; - } = new AvaloniaList(); - public string SearchChangeFilter { get => _searchChangeFilter; @@ -513,7 +507,6 @@ namespace SourceGit.ViewModels VisibleChanges = null; SelectedChanges = null; ViewRevisionFileContent = null; - Children.Clear(); if (_commit == null) return; @@ -530,12 +523,6 @@ namespace SourceGit.ViewModels Dispatcher.UIThread.Invoke(() => SignInfo = signInfo); }); - Task.Run(() => - { - var children = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA).Result(); - Dispatcher.UIThread.Invoke(() => Children.AddRange(children)); - }); - if (_cancelToken != null) _cancelToken.Requested = true; diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 5f80f5f9..76ea0227 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -51,7 +51,7 @@ - + @@ -122,37 +122,9 @@ - - - - - - - - - - - - - - - - - - + + - + SetValue(IssueTrackerRulesProperty, value); } - public static readonly StyledProperty> ChildrenProperty = - AvaloniaProperty.Register>(nameof(Children)); - - public AvaloniaList Children - { - get => GetValue(ChildrenProperty); - set => SetValue(ChildrenProperty, value); - } - public CommitBaseInfo() { InitializeComponent(); diff --git a/src/Views/CommitDetail.axaml b/src/Views/CommitDetail.axaml index 4c6fd5dc..cb99b3d9 100644 --- a/src/Views/CommitDetail.axaml +++ b/src/Views/CommitDetail.axaml @@ -24,7 +24,6 @@ SignInfo="{Binding SignInfo}" SupportsContainsIn="True" WebLinks="{Binding WebLinks}" - Children="{Binding Children}" IssueTrackerRules="{Binding IssueTrackerRules}"/> From 79c1fb63d012bd1a1eda29a6bfce32a4a2fd95c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 02:26:54 +0000 Subject: [PATCH 2/2] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1cc9b64e..e464f74c 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.56%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.86%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.60%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.86%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.86%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index fa6701f0..587ba99a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,10 +1,9 @@ -### de_DE.axaml: 98.56% +### de_DE.axaml: 98.70%
Missing Keys -- Text.CommitDetail.Info.Children - Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All - Text.Hotkeys.Repo.CreateBranchOnCommit @@ -17,17 +16,17 @@
-### es_ES.axaml: 99.86% +### es_ES.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +
-### fr_FR.axaml: 86.60% +### fr_FR.axaml: 86.58%
@@ -129,23 +128,23 @@
-### pt_BR.axaml: 99.86% +### pt_BR.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +
-### ru_RU.axaml: 99.86% +### ru_RU.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +