mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 22:01:10 +08: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:
committed by
GitHub
parent
cc1eb55cf0
commit
cc5bb5f6d4
@@ -78,6 +78,12 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public AvaloniaList<string> Children
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
} = new AvaloniaList<string>();
|
||||
|
||||
public string SearchChangeFilter
|
||||
{
|
||||
get => _searchChangeFilter;
|
||||
@@ -515,6 +521,7 @@ namespace SourceGit.ViewModels
|
||||
VisibleChanges = null;
|
||||
SelectedChanges = null;
|
||||
ViewRevisionFileContent = null;
|
||||
Children.Clear();
|
||||
|
||||
if (_commit == null)
|
||||
return;
|
||||
@@ -535,6 +542,18 @@ namespace SourceGit.ViewModels
|
||||
_cancelToken.Requested = true;
|
||||
|
||||
_cancelToken = new Commands.Command.CancelToken();
|
||||
|
||||
if (Preference.Instance.ShowChildren)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, _repo.Settings.BuildHistoriesFilter()) { Cancel = _cancelToken };
|
||||
var children = cmdChildren.Result();
|
||||
if (!cmdChildren.Cancel.Requested)
|
||||
Dispatcher.UIThread.Post(() => Children.AddRange(children));
|
||||
});
|
||||
}
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
var parent = _commit.Parents.Count == 0 ? "4b825dc642cb6eb9a060e54bf8d69288fbee4904" : _commit.Parents[0];
|
||||
|
||||
@@ -294,6 +294,12 @@ namespace SourceGit.ViewModels
|
||||
set => SetProperty(ref _statisticsSampleColor, value);
|
||||
}
|
||||
|
||||
public bool ShowChildren
|
||||
{
|
||||
get => _showChildren;
|
||||
set => SetProperty(ref _showChildren, value);
|
||||
}
|
||||
|
||||
public List<RepositoryNode> RepositoryNodes
|
||||
{
|
||||
get;
|
||||
@@ -617,5 +623,7 @@ namespace SourceGit.ViewModels
|
||||
private string _externalMergeToolPath = string.Empty;
|
||||
|
||||
private uint _statisticsSampleColor = 0xFF00FF00;
|
||||
|
||||
private bool _showChildren = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user