diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 5bb61b9c..2eb38873 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -111,6 +111,7 @@ Copy SHA Custom Action Interactive Rebase ${0}$ to Here + Merge to ${0}$ Merge ... Rebase ${0}$ to Here Reset ${0}$ to Here diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 7a0bc47e..f711cdee 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -114,6 +114,7 @@ 复制提交指纹 自定义操作 交互式变基(rebase -i) ${0}$ 到此处 + 合并(merge)此提交至 ${0}$ 合并(merge)... 变基(rebase) ${0}$ 到此处 重置(reset) ${0}$ 到此处 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 3ffbebc0..90444967 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -114,6 +114,7 @@ 複製提交編號 自訂動作 互動式重定基底 (rebase -i) ${0}$ 到此處 + 合併 (merge) 此提交到 ${0}$ 合併 (merge)... 重定基底 (rebase) ${0}$ 到此處 重設 (reset) ${0}$ 到此處 diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 8c4de43e..8f1e2662 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -513,6 +513,21 @@ namespace SourceGit.ViewModels e.Handled = true; }; menu.Items.Add(cherryPick); + + if (!commit.HasDecorators) + { + var merge = new MenuItem(); + merge.Header = new Views.NameHighlightedTextBlock("CommitCM.Merge", current.Name); + merge.Icon = App.CreateMenuIcon("Icons.Merge"); + merge.Click += (_, e) => + { + if (PopupHost.CanCreatePopup()) + PopupHost.ShowPopup(new Merge(_repo, commit, current.Name)); + + e.Handled = true; + }; + menu.Items.Add(merge); + } } else { diff --git a/src/ViewModels/Merge.cs b/src/ViewModels/Merge.cs index 670a1ba5..d07ee9b7 100644 --- a/src/ViewModels/Merge.cs +++ b/src/ViewModels/Merge.cs @@ -32,6 +32,17 @@ namespace SourceGit.ViewModels View = new Views.Merge() { DataContext = this }; } + public Merge(Repository repo, Models.Commit source, string into) + { + _repo = repo; + _sourceName = source.SHA; + + Source = source; + Into = into; + SelectedMode = AutoSelectMergeMode(); + View = new Views.Merge() { DataContext = this }; + } + public Merge(Repository repo, Models.Tag source, string into) { _repo = repo; diff --git a/src/Views/LauncherPage.axaml b/src/Views/LauncherPage.axaml index be2b339f..34e93841 100644 --- a/src/Views/LauncherPage.axaml +++ b/src/Views/LauncherPage.axaml @@ -77,7 +77,7 @@ HorizontalAlignment="Right" IsVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}">