mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
Show the list of children in the commit details (#710)
* feature: add children list to the commit base info view Useful for navigation between the commits. * feature: use repository filters to limit children search * feature: execute children search asynchronously * feature: respect global commit limit for a good measure * fix: input lines may contain several commits The first commit is always the immediate child, so take only 40 initial characters of the line * fix: hide children behind the preference * feature: make parents and children scrollable
This commit is contained in:
parent
cc1eb55cf0
commit
cc5bb5f6d4
9 changed files with 170 additions and 44 deletions
34
src/Commands/QueryCommitChildren.cs
Normal file
34
src/Commands/QueryCommitChildren.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SourceGit.ViewModels;
|
||||
|
||||
namespace SourceGit.Commands
|
||||
{
|
||||
public class QueryCommitChildren : Command
|
||||
{
|
||||
public QueryCommitChildren(string repo, string commit, 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));
|
||||
}
|
||||
|
||||
public IEnumerable<string> Result()
|
||||
{
|
||||
Exec();
|
||||
return _lines;
|
||||
}
|
||||
|
||||
private string _commit;
|
||||
private List<string> _lines = new List<string>();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue