mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
refactor: ux for in progress action (cherry-pick/rebase/revert/merge)
This commit is contained in:
parent
814af539cd
commit
53bcafa5ed
7 changed files with 243 additions and 123 deletions
45
src/SourceGit/Resources/Locales.Designer.cs
generated
45
src/SourceGit/Resources/Locales.Designer.cs
generated
|
@ -942,15 +942,6 @@ namespace SourceGit.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Conflict detected! Press 'Abort' to restore original HEAD..
|
|
||||||
/// </summary>
|
|
||||||
public static string Text_Conflict_Tip {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Text.Conflict.Tip", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Copy.
|
/// Looks up a localized string similar to Copy.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2049,6 +2040,42 @@ namespace SourceGit.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Cherry-Pick in progress. Press 'Abort' to restore original HEAD..
|
||||||
|
/// </summary>
|
||||||
|
public static string Text_InProgress_CherryPick {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Text.InProgress.CherryPick", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Merge request in progress. Press 'Abort' to restore original HEAD..
|
||||||
|
/// </summary>
|
||||||
|
public static string Text_InProgress_Merge {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Text.InProgress.Merge", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Rebase in progress. Press 'Abort' to restore original HEAD..
|
||||||
|
/// </summary>
|
||||||
|
public static string Text_InProgress_Rebase {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Text.InProgress.Rebase", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Revert in progress. Press 'Abort' to restore original HEAD..
|
||||||
|
/// </summary>
|
||||||
|
public static string Text_InProgress_Revert {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Text.InProgress.Revert", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Source Git.
|
/// Looks up a localized string similar to Source Git.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1161,9 +1161,6 @@
|
||||||
<data xml:space="preserve" name="Text.WorkingCopy.IncludeUntracked">
|
<data xml:space="preserve" name="Text.WorkingCopy.IncludeUntracked">
|
||||||
<value>INCLUDE UNTRACKED FILES</value>
|
<value>INCLUDE UNTRACKED FILES</value>
|
||||||
</data>
|
</data>
|
||||||
<data xml:space="preserve" name="Text.Conflict.Tip">
|
|
||||||
<value>Conflict detected! Press 'Abort' to restore original HEAD.</value>
|
|
||||||
</data>
|
|
||||||
<data xml:space="preserve" name="Text.ClearStashes">
|
<data xml:space="preserve" name="Text.ClearStashes">
|
||||||
<value>Clear Stashes</value>
|
<value>Clear Stashes</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -1338,4 +1335,16 @@
|
||||||
<data name="Text.About.SourceCode" xml:space="preserve">
|
<data name="Text.About.SourceCode" xml:space="preserve">
|
||||||
<value>• Source code can be found at </value>
|
<value>• Source code can be found at </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Text.InProgress.CherryPick" xml:space="preserve">
|
||||||
|
<value>Cherry-Pick in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Rebase" xml:space="preserve">
|
||||||
|
<value>Rebase in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Revert" xml:space="preserve">
|
||||||
|
<value>Revert in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Merge" xml:space="preserve">
|
||||||
|
<value>Merge request in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1161,9 +1161,6 @@
|
||||||
<data xml:space="preserve" name="Text.WorkingCopy.IncludeUntracked">
|
<data xml:space="preserve" name="Text.WorkingCopy.IncludeUntracked">
|
||||||
<value>INCLUDE UNTRACKED FILES</value>
|
<value>INCLUDE UNTRACKED FILES</value>
|
||||||
</data>
|
</data>
|
||||||
<data xml:space="preserve" name="Text.Conflict.Tip">
|
|
||||||
<value>Conflict detected! Press 'Abort' to restore original HEAD.</value>
|
|
||||||
</data>
|
|
||||||
<data xml:space="preserve" name="Text.ClearStashes">
|
<data xml:space="preserve" name="Text.ClearStashes">
|
||||||
<value>Clear Stashes</value>
|
<value>Clear Stashes</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -1338,4 +1335,16 @@
|
||||||
<data name="Text.About.SourceCode" xml:space="preserve">
|
<data name="Text.About.SourceCode" xml:space="preserve">
|
||||||
<value>• Source code can be found at </value>
|
<value>• Source code can be found at </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Text.InProgress.CherryPick" xml:space="preserve">
|
||||||
|
<value>Cherry-Pick in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Rebase" xml:space="preserve">
|
||||||
|
<value>Rebase in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Revert" xml:space="preserve">
|
||||||
|
<value>Revert in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Merge" xml:space="preserve">
|
||||||
|
<value>Merge request in progress. Press 'Abort' to restore original HEAD.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1158,9 +1158,6 @@
|
||||||
<data xml:space="preserve" name="Text.WorkingCopy.IncludeUntracked">
|
<data xml:space="preserve" name="Text.WorkingCopy.IncludeUntracked">
|
||||||
<value>显示未跟踪文件</value>
|
<value>显示未跟踪文件</value>
|
||||||
</data>
|
</data>
|
||||||
<data xml:space="preserve" name="Text.Conflict.Tip">
|
|
||||||
<value>检测到本地冲突! 点击【终止合并】回滚到合并操作前的状态。</value>
|
|
||||||
</data>
|
|
||||||
<data xml:space="preserve" name="Text.ClearStashes">
|
<data xml:space="preserve" name="Text.ClearStashes">
|
||||||
<value>丢弃贮藏确认</value>
|
<value>丢弃贮藏确认</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -1338,4 +1335,16 @@
|
||||||
<data name="Text.Repository.Fleet" xml:space="preserve">
|
<data name="Text.Repository.Fleet" xml:space="preserve">
|
||||||
<value>在 Fleet 中打开</value>
|
<value>在 Fleet 中打开</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Text.InProgress.CherryPick" xml:space="preserve">
|
||||||
|
<value>挑选(Cherry-Pick)操作进行中。点击【终止】回滚到操作前的状态。</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Rebase" xml:space="preserve">
|
||||||
|
<value>变基(Rebase)操作进行中。点击【终止】回滚到操作前的状态。</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Revert" xml:space="preserve">
|
||||||
|
<value>回滚提交操作进行中。点击【终止】回滚到操作前的状态。</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.InProgress.Merge" xml:space="preserve">
|
||||||
|
<value>合并操作进行中。点击【终止】回滚到操作前的状态。</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
89
src/SourceGit/ViewModels/InProgressContexts.cs
Normal file
89
src/SourceGit/ViewModels/InProgressContexts.cs
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace SourceGit.ViewModels
|
||||||
|
{
|
||||||
|
public abstract class InProgressContext
|
||||||
|
{
|
||||||
|
public string Repository
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Cmd
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InProgressContext(string repo, string cmd)
|
||||||
|
{
|
||||||
|
Repository = repo;
|
||||||
|
Cmd = cmd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Abort()
|
||||||
|
{
|
||||||
|
new Commands.Command()
|
||||||
|
{
|
||||||
|
WorkingDirectory = Repository,
|
||||||
|
Context = Repository,
|
||||||
|
Args = $"{Cmd} --abort",
|
||||||
|
}.Exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual bool Continue()
|
||||||
|
{
|
||||||
|
return new Commands.Command()
|
||||||
|
{
|
||||||
|
WorkingDirectory = Repository,
|
||||||
|
Context = Repository,
|
||||||
|
Args = $"-c core.editor=true {Cmd} --continue",
|
||||||
|
}.Exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CherryPickInProgress : InProgressContext
|
||||||
|
{
|
||||||
|
public CherryPickInProgress(string repo) : base(repo, "cherry-pick") { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RebaseInProgress : InProgressContext
|
||||||
|
{
|
||||||
|
public RebaseInProgress(Repository repo) : base(repo.FullPath, "rebase")
|
||||||
|
{
|
||||||
|
_gitDir = repo.GitDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Continue()
|
||||||
|
{
|
||||||
|
var succ = base.Continue();
|
||||||
|
if (succ)
|
||||||
|
{
|
||||||
|
var rebaseMergeHead = Path.Combine(_gitDir, "REBASE_HEAD");
|
||||||
|
var rebaseMergeFolder = Path.Combine(_gitDir, "rebase-merge");
|
||||||
|
var rebaseApplyFolder = Path.Combine(_gitDir, "rebase-apply");
|
||||||
|
if (File.Exists(rebaseMergeHead))
|
||||||
|
File.Delete(rebaseMergeHead);
|
||||||
|
if (Directory.Exists(rebaseMergeFolder))
|
||||||
|
Directory.Delete(rebaseMergeFolder);
|
||||||
|
if (Directory.Exists(rebaseApplyFolder))
|
||||||
|
Directory.Delete(rebaseApplyFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
return succ;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _gitDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RevertInProgress : InProgressContext
|
||||||
|
{
|
||||||
|
public RevertInProgress(string repo) : base(repo, "revert") { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MergeInProgress : InProgressContext
|
||||||
|
{
|
||||||
|
public MergeInProgress(string repo) : base(repo, "merge") { }
|
||||||
|
}
|
||||||
|
}
|
|
@ -141,20 +141,6 @@ namespace SourceGit.ViewModels
|
||||||
get => _stashesPage == null ? 0 : _stashesPage.Count;
|
get => _stashesPage == null ? 0 : _stashesPage.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public bool IsConflictBarVisible
|
|
||||||
{
|
|
||||||
get => _isConflictBarVisible;
|
|
||||||
private set => SetProperty(ref _isConflictBarVisible, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public bool HasUnsolvedConflict
|
|
||||||
{
|
|
||||||
get => _hasUnsolvedConflict;
|
|
||||||
private set => SetProperty(ref _hasUnsolvedConflict, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool CanCommitWithPush
|
public bool CanCommitWithPush
|
||||||
{
|
{
|
||||||
|
@ -219,6 +205,20 @@ namespace SourceGit.ViewModels
|
||||||
set => SetProperty(ref _isSubmoduleGroupExpanded, value);
|
set => SetProperty(ref _isSubmoduleGroupExpanded, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public InProgressContext InProgressContext
|
||||||
|
{
|
||||||
|
get => _inProgressContext;
|
||||||
|
private set => SetProperty(ref _inProgressContext, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool HasUnsolvedConflicts
|
||||||
|
{
|
||||||
|
get => _hasUnsolvedConflicts;
|
||||||
|
private set => SetProperty(ref _hasUnsolvedConflicts, value);
|
||||||
|
}
|
||||||
|
|
||||||
public void Open()
|
public void Open()
|
||||||
{
|
{
|
||||||
_watcher = new Models.Watcher(this);
|
_watcher = new Models.Watcher(this);
|
||||||
|
@ -227,8 +227,8 @@ namespace SourceGit.ViewModels
|
||||||
_stashesPage = new StashesPage(this);
|
_stashesPage = new StashesPage(this);
|
||||||
_selectedView = _histories;
|
_selectedView = _histories;
|
||||||
_selectedViewIndex = 0;
|
_selectedViewIndex = 0;
|
||||||
_isConflictBarVisible = false;
|
_inProgressContext = null;
|
||||||
_hasUnsolvedConflict = false;
|
_hasUnsolvedConflicts = false;
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
|
@ -262,6 +262,9 @@ namespace SourceGit.ViewModels
|
||||||
_isTagGroupExpanded = false;
|
_isTagGroupExpanded = false;
|
||||||
_isSubmoduleGroupExpanded = false;
|
_isSubmoduleGroupExpanded = false;
|
||||||
|
|
||||||
|
_inProgressContext = null;
|
||||||
|
_hasUnsolvedConflicts = false;
|
||||||
|
|
||||||
_remotes.Clear();
|
_remotes.Clear();
|
||||||
_branches.Clear();
|
_branches.Clear();
|
||||||
_localBranchTrees.Clear();
|
_localBranchTrees.Clear();
|
||||||
|
@ -450,90 +453,34 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
public async void ContinueMerge()
|
public async void ContinueMerge()
|
||||||
{
|
{
|
||||||
var cherryPickMerge = Path.Combine(_gitDir, "CHERRY_PICK_HEAD");
|
if (_inProgressContext != null)
|
||||||
var rebaseMerge = Path.Combine(_gitDir, "REBASE_HEAD");
|
|
||||||
var rebaseMergeFolder = Path.Combine(_gitDir, "rebase-merge");
|
|
||||||
var revertMerge = Path.Combine(_gitDir, "REVERT_HEAD");
|
|
||||||
var otherMerge = Path.Combine(_gitDir, "MERGE_HEAD");
|
|
||||||
|
|
||||||
var mode = "";
|
|
||||||
if (File.Exists(cherryPickMerge))
|
|
||||||
{
|
{
|
||||||
mode = "cherry-pick";
|
SetWatcherEnabled(false);
|
||||||
|
var succ = await Task.Run(_inProgressContext.Continue);
|
||||||
|
if (succ && _workingCopy != null)
|
||||||
|
{
|
||||||
|
_workingCopy.CommitMessage = string.Empty;
|
||||||
}
|
}
|
||||||
else if (File.Exists(rebaseMerge) && Directory.Exists(rebaseMergeFolder))
|
SetWatcherEnabled(true);
|
||||||
{
|
|
||||||
mode = "rebase";
|
|
||||||
}
|
|
||||||
else if (File.Exists(revertMerge))
|
|
||||||
{
|
|
||||||
mode = "revert";
|
|
||||||
}
|
|
||||||
else if (File.Exists(otherMerge))
|
|
||||||
{
|
|
||||||
mode = "merge";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MarkWorkingCopyDirtyManually();
|
MarkWorkingCopyDirtyManually();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var cmd = new Commands.Command();
|
|
||||||
cmd.WorkingDirectory = _fullpath;
|
|
||||||
cmd.Context = _fullpath;
|
|
||||||
cmd.Args = $"-c core.editor=true {mode} --continue";
|
|
||||||
|
|
||||||
SetWatcherEnabled(false);
|
|
||||||
var succ = await Task.Run(cmd.Exec);
|
|
||||||
SetWatcherEnabled(true);
|
|
||||||
|
|
||||||
if (succ)
|
|
||||||
{
|
|
||||||
if (_workingCopy != null)
|
|
||||||
_workingCopy.CommitMessage = string.Empty;
|
|
||||||
|
|
||||||
if (mode == "rebase")
|
|
||||||
{
|
|
||||||
if (File.Exists(rebaseMerge))
|
|
||||||
File.Delete(rebaseMerge);
|
|
||||||
if (Directory.Exists(rebaseMergeFolder))
|
|
||||||
Directory.Delete(rebaseMergeFolder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void AbortMerge()
|
public async void AbortMerge()
|
||||||
{
|
{
|
||||||
var cmd = new Commands.Command();
|
if (_inProgressContext != null)
|
||||||
cmd.WorkingDirectory = _fullpath;
|
|
||||||
cmd.Context = _fullpath;
|
|
||||||
|
|
||||||
if (File.Exists(Path.Combine(_gitDir, "CHERRY_PICK_HEAD")))
|
|
||||||
{
|
{
|
||||||
cmd.Args = "cherry-pick --abort";
|
SetWatcherEnabled(false);
|
||||||
}
|
await Task.Run(_inProgressContext.Abort);
|
||||||
else if (File.Exists(Path.Combine(_gitDir, "REBASE_HEAD")))
|
SetWatcherEnabled(true);
|
||||||
{
|
|
||||||
cmd.Args = "rebase --abort";
|
|
||||||
}
|
|
||||||
else if (File.Exists(Path.Combine(_gitDir, "REVERT_HEAD")))
|
|
||||||
{
|
|
||||||
cmd.Args = "revert --abort";
|
|
||||||
}
|
|
||||||
else if (File.Exists(Path.Combine(_gitDir, "MERGE_HEAD")))
|
|
||||||
{
|
|
||||||
cmd.Args = "merge --abort";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MarkWorkingCopyDirtyManually();
|
MarkWorkingCopyDirtyManually();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetWatcherEnabled(false);
|
|
||||||
await Task.Run(cmd.Exec);
|
|
||||||
SetWatcherEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RefreshBranches()
|
public void RefreshBranches()
|
||||||
|
@ -622,30 +569,39 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
var changes = new Commands.QueryLocalChanges(FullPath, _includeUntracked).Result();
|
var changes = new Commands.QueryLocalChanges(FullPath, _includeUntracked).Result();
|
||||||
var hasUnsolvedConflict = _workingCopy.SetData(changes);
|
var hasUnsolvedConflict = _workingCopy.SetData(changes);
|
||||||
|
var inProgress = null as InProgressContext;
|
||||||
|
|
||||||
var cherryPickMerge = Path.Combine(_gitDir, "CHERRY_PICK_HEAD");
|
|
||||||
var rebaseMerge = Path.Combine(_gitDir, "REBASE_HEAD");
|
|
||||||
var rebaseMergeFolder = Path.Combine(_gitDir, "rebase-merge");
|
var rebaseMergeFolder = Path.Combine(_gitDir, "rebase-merge");
|
||||||
var revertMerge = Path.Combine(_gitDir, "REVERT_HEAD");
|
var rebaseApplyFolder = Path.Combine(_gitDir, "rebase-apply");
|
||||||
var otherMerge = Path.Combine(_gitDir, "MERGE_HEAD");
|
if (File.Exists(Path.Combine(_gitDir, "CHERRY_PICK_HEAD")))
|
||||||
var runningMerge = (File.Exists(cherryPickMerge) ||
|
{
|
||||||
(File.Exists(rebaseMerge) && Directory.Exists(rebaseMergeFolder)) ||
|
inProgress = new CherryPickInProgress(_fullpath);
|
||||||
File.Exists(revertMerge) ||
|
}
|
||||||
File.Exists(otherMerge));
|
else if (File.Exists(Path.Combine(_gitDir, "REBASE_HEAD")) && Directory.Exists(rebaseMergeFolder))
|
||||||
|
{
|
||||||
if (!runningMerge)
|
inProgress = new RebaseInProgress(this);
|
||||||
|
}
|
||||||
|
else if (File.Exists(Path.Combine(_gitDir, "REVERT_HEAD")))
|
||||||
|
{
|
||||||
|
inProgress = new RevertInProgress(_fullpath);
|
||||||
|
}
|
||||||
|
else if (File.Exists(Path.Combine(_gitDir, "MERGE_HEAD")))
|
||||||
|
{
|
||||||
|
inProgress = new MergeInProgress(_fullpath);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (Directory.Exists(rebaseMergeFolder))
|
if (Directory.Exists(rebaseMergeFolder))
|
||||||
Directory.Delete(rebaseMergeFolder, true);
|
Directory.Delete(rebaseMergeFolder, true);
|
||||||
var applyFolder = Path.Combine(_gitDir, "rebase-apply");
|
|
||||||
if (Directory.Exists(applyFolder))
|
if (Directory.Exists(rebaseApplyFolder))
|
||||||
Directory.Delete(applyFolder, true);
|
Directory.Delete(rebaseApplyFolder, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatcher.UIThread.Invoke(() =>
|
Dispatcher.UIThread.Invoke(() =>
|
||||||
{
|
{
|
||||||
IsConflictBarVisible = runningMerge;
|
InProgressContext = inProgress;
|
||||||
HasUnsolvedConflict = hasUnsolvedConflict;
|
HasUnsolvedConflicts = hasUnsolvedConflict;
|
||||||
OnPropertyChanged(nameof(WorkingCopyChangesCount));
|
OnPropertyChanged(nameof(WorkingCopyChangesCount));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1359,9 +1315,10 @@ namespace SourceGit.ViewModels
|
||||||
private List<Models.BranchTreeNode> _remoteBranchTrees = new List<Models.BranchTreeNode>();
|
private List<Models.BranchTreeNode> _remoteBranchTrees = new List<Models.BranchTreeNode>();
|
||||||
private List<Models.Tag> _tags = new List<Models.Tag>();
|
private List<Models.Tag> _tags = new List<Models.Tag>();
|
||||||
private List<string> _submodules = new List<string>();
|
private List<string> _submodules = new List<string>();
|
||||||
private bool _isConflictBarVisible = false;
|
|
||||||
private bool _hasUnsolvedConflict = false;
|
|
||||||
private bool _canCommitWithPush = false;
|
private bool _canCommitWithPush = false;
|
||||||
private bool _includeUntracked = true;
|
private bool _includeUntracked = true;
|
||||||
|
|
||||||
|
private InProgressContext _inProgressContext = null;
|
||||||
|
private bool _hasUnsolvedConflicts = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,14 +464,34 @@
|
||||||
|
|
||||||
<!-- Right -->
|
<!-- Right -->
|
||||||
<Grid Grid.Column="2" RowDefinitions="Auto,*">
|
<Grid Grid.Column="2" RowDefinitions="Auto,*">
|
||||||
<Grid Height="26" Grid.Row="0" ColumnDefinitions="*,Auto,Auto,Auto" Background="{DynamicResource Brush.Conflict}" IsVisible="{Binding IsConflictBarVisible}">
|
<Grid Grid.Row="0" Height="26" ColumnDefinitions="*,Auto,Auto,Auto" Background="{DynamicResource Brush.Conflict}" IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
<TextBlock Grid.Column="0" Margin="8,0" FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.Conflict.Tip}"/>
|
<ContentControl Grid.Column="0" Margin="8,0" Content="{Binding InProgressContext}">
|
||||||
|
<ContentControl.DataTemplates>
|
||||||
|
<DataTemplate DataType="vm:CherryPickInProgress">
|
||||||
|
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.CherryPick}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate DataType="vm:RebaseInProgress">
|
||||||
|
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.Rebase}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate DataType="vm:RevertInProgress">
|
||||||
|
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.Revert}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate DataType="vm:MergeInProgress">
|
||||||
|
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.Merge}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentControl.DataTemplates>
|
||||||
|
</ContentControl>
|
||||||
|
|
||||||
<Button Grid.Column="1" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Resolve}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding GotoResolve}">
|
<Button Grid.Column="1" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Resolve}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding GotoResolve}">
|
||||||
<Button.IsVisible>
|
<Button.IsVisible>
|
||||||
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsNotOne}"/>
|
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsNotOne}"/>
|
||||||
</Button.IsVisible>
|
</Button.IsVisible>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="2" Classes="flat primary" FontWeight="Regular" Content="{DynamicResource Text.Repository.Continue}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding ContinueMerge}" IsVisible="{Binding !HasUnsolvedConflict}"/>
|
|
||||||
|
<Button Grid.Column="2" Classes="flat primary" FontWeight="Regular" Content="{DynamicResource Text.Repository.Continue}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding ContinueMerge}" IsVisible="{Binding !HasUnsolvedConflicts}"/>
|
||||||
<Button Grid.Column="3" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Abort}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding AbortMerge}"/>
|
<Button Grid.Column="3" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Abort}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding AbortMerge}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue