mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
code_review: PR #710
* SourceGit.Commands.* should not reference SourceGit.ViewModels.* * remove unused namespace using * update translations for zh_CN and zh_TW * use WrapPanel instead of inner ScrollViewer * some other UI/UX changes Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
dd0580d0f5
commit
ab2156bfc2
7 changed files with 107 additions and 110 deletions
|
@ -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<string> 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<string> _lines = new List<string>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue