diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs index c110ef94..293de912 100644 --- a/src/Commands/QueryCommitChildren.cs +++ b/src/Commands/QueryCommitChildren.cs @@ -1,25 +1,17 @@ -using System; -using System.Collections.Generic; -using SourceGit.ViewModels; +using System.Collections.Generic; namespace SourceGit.Commands { public class QueryCommitChildren : Command { - public QueryCommitChildren(string repo, string commit, string filters) + public QueryCommitChildren(string repo, string commit, int max, string filters) { WorkingDirectory = repo; Context = repo; _commit = commit; if (string.IsNullOrEmpty(filters)) - filters = "--all"; - Args = $"rev-list -{Preference.Instance.MaxHistoryCommits} --parents {filters} ^{commit}"; - } - - protected override void OnReadline(string line) - { - if (line.Contains(_commit)) - _lines.Add(line.Substring(0, 40)); + filters = "--branches --remotes --tags"; + Args = $"rev-list -{max} --parents {filters} ^{commit}"; } public IEnumerable Result() @@ -28,6 +20,12 @@ namespace SourceGit.Commands return _lines; } + protected override void OnReadline(string line) + { + if (line.Contains(_commit)) + _lines.Add(line.Substring(0, 40)); + } + private string _commit; private List _lines = new List(); } diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index a1779a36..1e6fca06 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -128,6 +128,7 @@ 基本信息 修改者 变更列表 + 子提交 提交者 查看包含此提交的分支/标签 本提交已被以下分支/标签包含 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index c821679b..06ee4b37 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -128,7 +128,8 @@ 基本資訊 作者 變更列表 - 提交者 + 後續提交 + 提交 檢視包含此提交的分支或標籤 本提交包含於以下分支或標籤 僅顯示前 100 項變更。請前往 [變更對比] 頁面以瀏覽所有變更。 diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 6d819300..e874b09b 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -547,7 +547,9 @@ namespace SourceGit.ViewModels { Task.Run(() => { - var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, _repo.Settings.BuildHistoriesFilter()) { Cancel = _cancelToken }; + var max = Preference.Instance.MaxHistoryCommits; + var filter = _repo.Settings.BuildHistoriesFilter(); + var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max, filter) { Cancel = _cancelToken }; var children = cmdChildren.Result(); if (!cmdChildren.Cancel.Requested) Dispatcher.UIThread.Post(() => Children.AddRange(children)); diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 9d3de526..70f0041f 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -144,6 +144,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _showAuthorTimeInGraph, value); } + public bool ShowChildren + { + get => _showChildren; + set => SetProperty(ref _showChildren, value); + } + public string IgnoreUpdateTag { get => _ignoreUpdateTag; @@ -294,12 +300,6 @@ namespace SourceGit.ViewModels set => SetProperty(ref _statisticsSampleColor, value); } - public bool ShowChildren - { - get => _showChildren; - set => SetProperty(ref _showChildren, value); - } - public List RepositoryNodes { get; @@ -598,6 +598,7 @@ namespace SourceGit.ViewModels private int _subjectGuideLength = 50; private bool _useFixedTabWidth = true; private bool _showAuthorTimeInGraph = false; + private bool _showChildren = false; private bool _check4UpdatesOnStartup = true; private double _lastCheckUpdateTime = 0; @@ -623,7 +624,5 @@ namespace SourceGit.ViewModels private string _externalMergeToolPath = string.Empty; private uint _statisticsSampleColor = 0xFF00FF00; - - private bool _showChildren = false; } } diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index d3d3bb0e..b58c3daf 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -53,8 +53,8 @@ - - + + - - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + - + - + + Content="{DynamicResource Text.Preference.General.ShowChildren}" + IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowChildren, Mode=TwoWay}"/> + Content="{DynamicResource Text.Preference.General.Check4UpdatesOnStartup}" + IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=Check4UpdatesOnStartup, Mode=TwoWay}"/>