mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-24 20:05:00 +00:00
feature: allow merging multiple branches from branch tree
This commit is contained in:
parent
2518f34b86
commit
227ac0fbcc
3 changed files with 19 additions and 0 deletions
|
@ -58,6 +58,7 @@
|
|||
<x:String x:Key="Text.BranchCM.FetchInto" xml:space="preserve">Fetch ${0}$ into ${1}$...</x:String>
|
||||
<x:String x:Key="Text.BranchCM.Finish" xml:space="preserve">Git Flow - Finish ${0}$</x:String>
|
||||
<x:String x:Key="Text.BranchCM.Merge" xml:space="preserve">Merge ${0}$ into ${1}$...</x:String>
|
||||
<x:String x:Key="Text.BranchCM.MergeMultiBranches" xml:space="preserve">Merge selected {0} branches</x:String>
|
||||
<x:String x:Key="Text.BranchCM.Pull" xml:space="preserve">Pull ${0}$</x:String>
|
||||
<x:String x:Key="Text.BranchCM.PullInto" xml:space="preserve">Pull ${0}$ into ${1}$...</x:String>
|
||||
<x:String x:Key="Text.BranchCM.Push" xml:space="preserve">Push ${0}$</x:String>
|
||||
|
|
|
@ -13,6 +13,7 @@ using Avalonia.Media.Imaging;
|
|||
using Avalonia.Threading;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using SourceGit.Models;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
|
@ -950,6 +951,12 @@ namespace SourceGit.ViewModels
|
|||
PopupHost.ShowPopup(new DeleteMultipleBranches(this, branches, isLocal));
|
||||
}
|
||||
|
||||
public void MergeMultipleBranches(List<Models.Branch> branches)
|
||||
{
|
||||
if (PopupHost.CanCreatePopup())
|
||||
PopupHost.ShowPopup(new MergeMultiple(this, branches.ConvertAll(b => _histories?.Commits?.Find(c => c.SHA == b.Head))));
|
||||
}
|
||||
|
||||
public void CreateNewTag()
|
||||
{
|
||||
if (_currentBranch == null)
|
||||
|
|
|
@ -405,6 +405,17 @@ namespace SourceGit.Views
|
|||
ev.Handled = true;
|
||||
};
|
||||
menu.Items.Add(deleteMulti);
|
||||
|
||||
var mergeMulti = new MenuItem();
|
||||
mergeMulti.Header = App.Text("BranchCM.MergeMultiBranches", branches.Count);
|
||||
mergeMulti.Icon = App.CreateMenuIcon("Icons.Merge");
|
||||
mergeMulti.Click += (_, ev) =>
|
||||
{
|
||||
repo.MergeMultipleBranches(branches);
|
||||
ev.Handled = true;
|
||||
};
|
||||
menu.Items.Add(mergeMulti);
|
||||
|
||||
menu?.Open(this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue