mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
enhance: supports to navigate to target commit while resolving conflicts
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
ca6d41ee60
commit
83f23583be
3 changed files with 24 additions and 18 deletions
|
@ -35,14 +35,8 @@
|
||||||
}
|
}
|
||||||
else if (context is RebaseInProgress rebase)
|
else if (context is RebaseInProgress rebase)
|
||||||
{
|
{
|
||||||
Theirs = repo.Branches.Find(x => x.IsLocal && x.Name == rebase.HeadName) ??
|
var b = repo.Branches.Find(x => x.IsLocal && x.Name == rebase.HeadName);
|
||||||
new Models.Branch()
|
Theirs = (object)b ?? rebase.StoppedAt;
|
||||||
{
|
|
||||||
IsLocal = true,
|
|
||||||
Name = rebase.HeadName,
|
|
||||||
FullName = $"refs/heads/{rebase.HeadName}"
|
|
||||||
};
|
|
||||||
|
|
||||||
Mine = rebase.Onto;
|
Mine = rebase.Onto;
|
||||||
}
|
}
|
||||||
else if (context is RevertInProgress revert)
|
else if (context is RevertInProgress revert)
|
||||||
|
|
|
@ -211,7 +211,12 @@
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Branch}"/>
|
<Path Width="12" Height="12" Data="{StaticResource Icons.Branch}"/>
|
||||||
<TextBlock Margin="4,0,0,0" Text="{Binding FriendlyName}"/>
|
<TextBlock Margin="4,0,0,0" Text="{Binding FriendlyName}"/>
|
||||||
<TextBlock Margin="4,0,0,0" Text="{Binding Head, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange"/>
|
<TextBlock Margin="4,0,0,0"
|
||||||
|
Text="{Binding Head, Converter={x:Static c:StringConverters.ToShortSHA}}"
|
||||||
|
Foreground="DarkOrange"
|
||||||
|
TextDecorations="Underline"
|
||||||
|
Cursor="Hand"
|
||||||
|
PointerPressed="OnPressedSHA"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
|
@ -225,18 +230,15 @@
|
||||||
FontSize="11"
|
FontSize="11"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
UseGraphColor="False"/>
|
UseGraphColor="False"/>
|
||||||
<TextBlock Margin="4,0,0,0" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange"/>
|
<TextBlock Margin="4,0,0,0"
|
||||||
|
Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
|
||||||
|
Foreground="DarkOrange"
|
||||||
|
TextDecorations="Underline"
|
||||||
|
Cursor="Hand"
|
||||||
|
PointerPressed="OnPressedSHA"/>
|
||||||
<TextBlock Margin="4,0,0,0" Text="{Binding Subject}"/>
|
<TextBlock Margin="4,0,0,0" Text="{Binding Subject}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
<DataTemplate DataType="m:Tag">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Tag}"/>
|
|
||||||
<TextBlock Margin="4,0,0,0" Text="{Binding Name}"/>
|
|
||||||
<TextBlock Margin="4,0,0,0" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange"/>
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</StackPanel.DataTemplates>
|
</StackPanel.DataTemplates>
|
||||||
|
|
||||||
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
|
using Avalonia.VisualTree;
|
||||||
|
|
||||||
namespace SourceGit.Views
|
namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
|
@ -159,5 +160,14 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
|
||||||
|
{
|
||||||
|
var repoView = this.FindAncestorOfType<Repository>();
|
||||||
|
if (repoView is { DataContext: ViewModels.Repository repo } && sender is TextBlock text)
|
||||||
|
repo.NavigateToCommit(text.Text);
|
||||||
|
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue