mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
Compare commits
7 commits
36ecbcc4e0
...
0ac1031c4c
Author | SHA1 | Date | |
---|---|---|---|
|
0ac1031c4c | ||
|
2053ce033d | ||
|
e17b53da42 | ||
|
9dd4166009 | ||
|
a10f9e0dd0 | ||
|
0dd6692cd8 | ||
|
dcaeaef48a |
19 changed files with 366 additions and 189 deletions
|
@ -47,7 +47,7 @@
|
|||
|
||||
## Translation Status
|
||||
|
||||
[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-97.64%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.91%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-95.13%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-95.69%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-96.94%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-98.05%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md)
|
||||
[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-97.50%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.78%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-95.00%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-95.56%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-96.81%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-97.92%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md)
|
||||
|
||||
## How to Use
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
### de_DE.axaml: 97.64%
|
||||
### de_DE.axaml: 97.50%
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Missing Keys</summary>
|
||||
|
||||
- Text.BranchCM.MergeMultiBranches
|
||||
- Text.CommitCM.Merge
|
||||
- Text.CommitCM.MergeMultiple
|
||||
- Text.CommitDetail.Files.Search
|
||||
- Text.Diff.UseBlockNavigation
|
||||
|
@ -24,13 +25,14 @@
|
|||
|
||||
</details>
|
||||
|
||||
### es_ES.axaml: 97.91%
|
||||
### es_ES.axaml: 97.78%
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Missing Keys</summary>
|
||||
|
||||
- Text.BranchCM.MergeMultiBranches
|
||||
- Text.CommitCM.Merge
|
||||
- Text.CommitCM.MergeMultiple
|
||||
- Text.Diff.UseBlockNavigation
|
||||
- Text.FileCM.ResolveUsing
|
||||
|
@ -48,7 +50,7 @@
|
|||
|
||||
</details>
|
||||
|
||||
### fr_FR.axaml: 95.13%
|
||||
### fr_FR.axaml: 95.00%
|
||||
|
||||
|
||||
<details>
|
||||
|
@ -58,6 +60,7 @@
|
|||
- Text.CherryPick.AppendSourceToMessage
|
||||
- Text.CherryPick.Mainline.Tips
|
||||
- Text.CommitCM.CherryPickMultiple
|
||||
- Text.CommitCM.Merge
|
||||
- Text.CommitCM.MergeMultiple
|
||||
- Text.CommitDetail.Files.Search
|
||||
- Text.Diff.UseBlockNavigation
|
||||
|
@ -92,13 +95,14 @@
|
|||
|
||||
</details>
|
||||
|
||||
### it_IT.axaml: 95.69%
|
||||
### it_IT.axaml: 95.56%
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Missing Keys</summary>
|
||||
|
||||
- Text.BranchCM.MergeMultiBranches
|
||||
- Text.CommitCM.Merge
|
||||
- Text.CommitCM.MergeMultiple
|
||||
- Text.CommitDetail.Files.Search
|
||||
- Text.CommitDetail.Info.Children
|
||||
|
@ -132,13 +136,14 @@
|
|||
|
||||
</details>
|
||||
|
||||
### pt_BR.axaml: 96.94%
|
||||
### pt_BR.axaml: 96.81%
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Missing Keys</summary>
|
||||
|
||||
- Text.BranchCM.MergeMultiBranches
|
||||
- Text.CommitCM.Merge
|
||||
- Text.CommitCM.MergeMultiple
|
||||
- Text.CommitDetail.Files.Search
|
||||
- Text.CommitDetail.Info.Children
|
||||
|
@ -163,13 +168,14 @@
|
|||
|
||||
</details>
|
||||
|
||||
### ru_RU.axaml: 98.05%
|
||||
### ru_RU.axaml: 97.92%
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Missing Keys</summary>
|
||||
|
||||
- Text.BranchCM.MergeMultiBranches
|
||||
- Text.CommitCM.Merge
|
||||
- Text.CommitCM.MergeMultiple
|
||||
- Text.FileCM.ResolveUsing
|
||||
- Text.Hotkeys.Global.Clone
|
||||
|
|
|
@ -111,6 +111,7 @@
|
|||
<x:String x:Key="Text.CommitCM.CopySHA" xml:space="preserve">Copy SHA</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CustomAction" xml:space="preserve">Custom Action</x:String>
|
||||
<x:String x:Key="Text.CommitCM.InteractiveRebase" xml:space="preserve">Interactive Rebase ${0}$ to Here</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Merge" xml:space="preserve">Merge to ${0}$</x:String>
|
||||
<x:String x:Key="Text.CommitCM.MergeMultiple" xml:space="preserve">Merge ...</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Rebase" xml:space="preserve">Rebase ${0}$ to Here</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Reset" xml:space="preserve">Reset ${0}$ to Here</x:String>
|
||||
|
|
|
@ -114,6 +114,7 @@
|
|||
<x:String x:Key="Text.CommitCM.CopySHA" xml:space="preserve">复制提交指纹</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CustomAction" xml:space="preserve">自定义操作</x:String>
|
||||
<x:String x:Key="Text.CommitCM.InteractiveRebase" xml:space="preserve">交互式变基(rebase -i) ${0}$ 到此处</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Merge" xml:space="preserve">合并(merge)此提交至 ${0}$</x:String>
|
||||
<x:String x:Key="Text.CommitCM.MergeMultiple" xml:space="preserve">合并(merge)...</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Rebase" xml:space="preserve">变基(rebase) ${0}$ 到此处</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Reset" xml:space="preserve">重置(reset) ${0}$ 到此处</x:String>
|
||||
|
|
|
@ -114,6 +114,7 @@
|
|||
<x:String x:Key="Text.CommitCM.CopySHA" xml:space="preserve">複製提交編號</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CustomAction" xml:space="preserve">自訂動作</x:String>
|
||||
<x:String x:Key="Text.CommitCM.InteractiveRebase" xml:space="preserve">互動式重定基底 (rebase -i) ${0}$ 到此處</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Merge" xml:space="preserve">合併 (merge) 此提交到 ${0}$</x:String>
|
||||
<x:String x:Key="Text.CommitCM.MergeMultiple" xml:space="preserve">合併 (merge)...</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Rebase" xml:space="preserve">重定基底 (rebase) ${0}$ 到此處</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Reset" xml:space="preserve">重設 (reset) ${0}$ 到此處</x:String>
|
||||
|
|
|
@ -72,10 +72,9 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var succ = false;
|
||||
if (IsMergeCommit)
|
||||
{
|
||||
succ = new Commands.CherryPick(
|
||||
new Commands.CherryPick(
|
||||
_repo.FullPath,
|
||||
Targets[0].SHA,
|
||||
!AutoCommit,
|
||||
|
@ -84,7 +83,7 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
else
|
||||
{
|
||||
succ = new Commands.CherryPick(
|
||||
new Commands.CherryPick(
|
||||
_repo.FullPath,
|
||||
string.Join(' ', Targets.ConvertAll(c => c.SHA)),
|
||||
!AutoCommit,
|
||||
|
@ -93,7 +92,7 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
return succ;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
78
src/ViewModels/Conflict.cs
Normal file
78
src/ViewModels/Conflict.cs
Normal file
|
@ -0,0 +1,78 @@
|
|||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class Conflict
|
||||
{
|
||||
public object Theirs
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public object Mine
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool IsResolved
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public Conflict(Repository repo, WorkingCopy wc, Models.Change change)
|
||||
{
|
||||
_wc = wc;
|
||||
_change = change;
|
||||
|
||||
IsResolved = new Commands.IsConflictResolved(repo.FullPath, change).ReadToEnd().IsSuccess;
|
||||
|
||||
var context = wc.InProgressContext;
|
||||
if (context is CherryPickInProgress cherryPick)
|
||||
{
|
||||
Theirs = cherryPick.Head;
|
||||
Mine = repo.CurrentBranch;
|
||||
}
|
||||
else if (context is RebaseInProgress rebase)
|
||||
{
|
||||
Theirs = repo.Branches.Find(x => x.IsLocal && x.Name == rebase.HeadName) ??
|
||||
new Models.Branch()
|
||||
{
|
||||
IsLocal = true,
|
||||
Name = rebase.HeadName,
|
||||
FullName = $"refs/heads/{rebase.HeadName}"
|
||||
};
|
||||
|
||||
Mine = rebase.Onto;
|
||||
}
|
||||
else if (context is RevertInProgress revert)
|
||||
{
|
||||
Theirs = revert.Head;
|
||||
Mine = repo.CurrentBranch;
|
||||
}
|
||||
else if (context is MergeInProgress merge)
|
||||
{
|
||||
Theirs = merge.Source;
|
||||
Mine = repo.CurrentBranch;
|
||||
}
|
||||
}
|
||||
|
||||
public void UseTheirs()
|
||||
{
|
||||
_wc.UseTheirs([_change]);
|
||||
}
|
||||
|
||||
public void UseMine()
|
||||
{
|
||||
_wc.UseMine([_change]);
|
||||
}
|
||||
|
||||
public void OpenExternalMergeTool()
|
||||
{
|
||||
_wc.UseExternalMergeTool(_change);
|
||||
}
|
||||
|
||||
private WorkingCopy _wc = null;
|
||||
private Models.Change _change = null;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -4,51 +4,29 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
public abstract class InProgressContext
|
||||
{
|
||||
public string Repository
|
||||
public InProgressContext(string repo, string cmd)
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Cmd
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool CanSkip
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
public InProgressContext(string repo, string cmd, bool canSkip)
|
||||
{
|
||||
Repository = repo;
|
||||
Cmd = cmd;
|
||||
CanSkip = canSkip;
|
||||
_repo = repo;
|
||||
_cmd = cmd;
|
||||
}
|
||||
|
||||
public bool Abort()
|
||||
{
|
||||
return new Commands.Command()
|
||||
{
|
||||
WorkingDirectory = Repository,
|
||||
Context = Repository,
|
||||
Args = $"{Cmd} --abort",
|
||||
WorkingDirectory = _repo,
|
||||
Context = _repo,
|
||||
Args = $"{_cmd} --abort",
|
||||
}.Exec();
|
||||
}
|
||||
|
||||
public bool Skip()
|
||||
public virtual bool Skip()
|
||||
{
|
||||
if (!CanSkip)
|
||||
return true;
|
||||
|
||||
return new Commands.Command()
|
||||
{
|
||||
WorkingDirectory = Repository,
|
||||
Context = Repository,
|
||||
Args = $"{Cmd} --skip",
|
||||
WorkingDirectory = _repo,
|
||||
Context = _repo,
|
||||
Args = $"{_cmd} --skip",
|
||||
}.Exec();
|
||||
}
|
||||
|
||||
|
@ -56,10 +34,10 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
return new Commands.Command()
|
||||
{
|
||||
WorkingDirectory = Repository,
|
||||
Context = Repository,
|
||||
WorkingDirectory = _repo,
|
||||
Context = _repo,
|
||||
Editor = Commands.Command.EditorType.None,
|
||||
Args = $"{Cmd} --continue",
|
||||
Args = $"{_cmd} --continue",
|
||||
}.Exec();
|
||||
}
|
||||
|
||||
|
@ -75,6 +53,9 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return commit.SHA.Substring(0, 10);
|
||||
}
|
||||
|
||||
protected string _repo = string.Empty;
|
||||
protected string _cmd = string.Empty;
|
||||
}
|
||||
|
||||
public class CherryPickInProgress : InProgressContext
|
||||
|
@ -90,7 +71,7 @@ namespace SourceGit.ViewModels
|
|||
get => GetFriendlyNameOfCommit(Head);
|
||||
}
|
||||
|
||||
public CherryPickInProgress(Repository repo) : base(repo.FullPath, "cherry-pick", true)
|
||||
public CherryPickInProgress(Repository repo) : base(repo.FullPath, "cherry-pick")
|
||||
{
|
||||
var headSHA = File.ReadAllText(Path.Combine(repo.GitDir, "CHERRY_PICK_HEAD")).Trim();
|
||||
Head = new Commands.QuerySingleCommit(repo.FullPath, headSHA).Result() ?? new Models.Commit() { SHA = headSHA };
|
||||
|
@ -122,7 +103,7 @@ namespace SourceGit.ViewModels
|
|||
private set;
|
||||
}
|
||||
|
||||
public RebaseInProgress(Repository repo) : base(repo.FullPath, "rebase", true)
|
||||
public RebaseInProgress(Repository repo) : base(repo.FullPath, "rebase")
|
||||
{
|
||||
_gitDir = repo.GitDir;
|
||||
|
||||
|
@ -141,8 +122,8 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
var succ = new Commands.Command()
|
||||
{
|
||||
WorkingDirectory = Repository,
|
||||
Context = Repository,
|
||||
WorkingDirectory = _repo,
|
||||
Context = _repo,
|
||||
Editor = Commands.Command.EditorType.RebaseEditor,
|
||||
Args = $"rebase --continue",
|
||||
}.Exec();
|
||||
|
@ -177,7 +158,7 @@ namespace SourceGit.ViewModels
|
|||
private set;
|
||||
}
|
||||
|
||||
public RevertInProgress(Repository repo) : base(repo.FullPath, "revert", false)
|
||||
public RevertInProgress(Repository repo) : base(repo.FullPath, "revert")
|
||||
{
|
||||
var headSHA = File.ReadAllText(Path.Combine(repo.GitDir, "REVERT_HEAD")).Trim();
|
||||
Head = new Commands.QuerySingleCommit(repo.FullPath, headSHA).Result() ?? new Models.Commit() { SHA = headSHA };
|
||||
|
@ -203,12 +184,17 @@ namespace SourceGit.ViewModels
|
|||
get => GetFriendlyNameOfCommit(Source);
|
||||
}
|
||||
|
||||
public MergeInProgress(Repository repo) : base(repo.FullPath, "merge", false)
|
||||
public MergeInProgress(Repository repo) : base(repo.FullPath, "merge")
|
||||
{
|
||||
Current = Commands.Branch.ShowCurrent(repo.FullPath);
|
||||
|
||||
var sourceSHA = File.ReadAllText(Path.Combine(repo.GitDir, "MERGE_HEAD")).Trim();
|
||||
Source = new Commands.QuerySingleCommit(repo.FullPath, sourceSHA).Result() ?? new Models.Commit() { SHA = sourceSHA };
|
||||
}
|
||||
|
||||
public override bool Skip()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -764,6 +764,11 @@ namespace SourceGit.ViewModels
|
|||
_workingCopy?.StashAll(autoStart);
|
||||
}
|
||||
|
||||
public void SkipMerge()
|
||||
{
|
||||
_workingCopy?.SkipMerge();
|
||||
}
|
||||
|
||||
public void AbortMerge()
|
||||
{
|
||||
_workingCopy?.AbortMerge();
|
||||
|
|
|
@ -31,9 +31,9 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var succ = new Commands.Revert(_repo.FullPath, Target.SHA, AutoCommit).Exec();
|
||||
new Commands.Revert(_repo.FullPath, Target.SHA, AutoCommit).Exec();
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
return succ;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -11,26 +11,6 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
|||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class ConflictContext : ObservableObject
|
||||
{
|
||||
public bool IsResolved
|
||||
{
|
||||
get => _isResolved;
|
||||
set => SetProperty(ref _isResolved, value);
|
||||
}
|
||||
|
||||
public ConflictContext(string repo, Models.Change change)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
var result = new Commands.IsConflictResolved(repo, change).ReadToEnd().IsSuccess;
|
||||
Dispatcher.UIThread.Post(() => IsResolved = result);
|
||||
});
|
||||
}
|
||||
|
||||
private bool _isResolved = false;
|
||||
}
|
||||
|
||||
public class WorkingCopy : ObservableObject
|
||||
{
|
||||
public bool IncludeUntracked
|
||||
|
@ -49,11 +29,7 @@ namespace SourceGit.ViewModels
|
|||
public bool CanCommitWithPush
|
||||
{
|
||||
get => _canCommitWithPush;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _canCommitWithPush, value))
|
||||
OnPropertyChanged(nameof(IsCommitWithPushVisible));
|
||||
}
|
||||
set => SetProperty(ref _canCommitWithPush, value);
|
||||
}
|
||||
|
||||
public bool HasUnsolvedConflicts
|
||||
|
@ -109,16 +85,10 @@ namespace SourceGit.ViewModels
|
|||
|
||||
Staged = GetStagedChanges();
|
||||
SelectedStaged = [];
|
||||
OnPropertyChanged(nameof(IsCommitWithPushVisible));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsCommitWithPushVisible
|
||||
{
|
||||
get => !UseAmend && CanCommitWithPush;
|
||||
}
|
||||
|
||||
public List<Models.Change> Unstaged
|
||||
{
|
||||
get => _unstaged;
|
||||
|
@ -440,6 +410,54 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public async void UseTheirs(List<Models.Change> changes)
|
||||
{
|
||||
var files = new List<string>();
|
||||
foreach (var change in changes)
|
||||
{
|
||||
if (change.IsConflit)
|
||||
files.Add(change.Path);
|
||||
}
|
||||
|
||||
_repo.SetWatcherEnabled(false);
|
||||
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).UseTheirs(files));
|
||||
if (succ)
|
||||
{
|
||||
await Task.Run(() => new Commands.Add(_repo.FullPath, changes).Exec());
|
||||
}
|
||||
_repo.MarkWorkingCopyDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
public async void UseMine(List<Models.Change> changes)
|
||||
{
|
||||
var files = new List<string>();
|
||||
foreach (var change in changes)
|
||||
{
|
||||
if (change.IsConflit)
|
||||
files.Add(change.Path);
|
||||
}
|
||||
|
||||
_repo.SetWatcherEnabled(false);
|
||||
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).UseMine(files));
|
||||
if (succ)
|
||||
{
|
||||
await Task.Run(() => new Commands.Add(_repo.FullPath, changes).Exec());
|
||||
}
|
||||
_repo.MarkWorkingCopyDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
public async void UseExternalMergeTool(Models.Change change)
|
||||
{
|
||||
var toolType = Preference.Instance.ExternalMergeToolType;
|
||||
var toolPath = Preference.Instance.ExternalMergeToolPath;
|
||||
|
||||
_repo.SetWatcherEnabled(false);
|
||||
await Task.Run(() => Commands.MergeTool.OpenForMerge(_repo.FullPath, toolType, toolPath, change.Path));
|
||||
_repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
public void ContinueMerge()
|
||||
{
|
||||
if (_inProgressContext != null)
|
||||
|
@ -463,6 +481,29 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public void SkipMerge()
|
||||
{
|
||||
if (_inProgressContext != null)
|
||||
{
|
||||
_repo.SetWatcherEnabled(false);
|
||||
Task.Run(() =>
|
||||
{
|
||||
var succ = _inProgressContext.Skip();
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
if (succ)
|
||||
CommitMessage = string.Empty;
|
||||
|
||||
_repo.SetWatcherEnabled(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
_repo.MarkWorkingCopyDirtyManually();
|
||||
}
|
||||
}
|
||||
|
||||
public void AbortMerge()
|
||||
{
|
||||
if (_inProgressContext != null)
|
||||
|
@ -1438,59 +1479,11 @@ namespace SourceGit.ViewModels
|
|||
if (change == null)
|
||||
DetailContext = null;
|
||||
else if (change.IsConflit && isUnstaged)
|
||||
DetailContext = new ConflictContext(_repo.FullPath, change);
|
||||
DetailContext = new Conflict(_repo, this, change);
|
||||
else
|
||||
DetailContext = new DiffContext(_repo.FullPath, new Models.DiffOption(change, isUnstaged), _detailContext as DiffContext);
|
||||
}
|
||||
|
||||
private async void UseTheirs(List<Models.Change> changes)
|
||||
{
|
||||
var files = new List<string>();
|
||||
foreach (var change in changes)
|
||||
{
|
||||
if (change.IsConflit)
|
||||
files.Add(change.Path);
|
||||
}
|
||||
|
||||
_repo.SetWatcherEnabled(false);
|
||||
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).UseTheirs(files));
|
||||
if (succ)
|
||||
{
|
||||
await Task.Run(() => new Commands.Add(_repo.FullPath, changes).Exec());
|
||||
}
|
||||
_repo.MarkWorkingCopyDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
private async void UseMine(List<Models.Change> changes)
|
||||
{
|
||||
var files = new List<string>();
|
||||
foreach (var change in changes)
|
||||
{
|
||||
if (change.IsConflit)
|
||||
files.Add(change.Path);
|
||||
}
|
||||
|
||||
_repo.SetWatcherEnabled(false);
|
||||
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).UseMine(files));
|
||||
if (succ)
|
||||
{
|
||||
await Task.Run(() => new Commands.Add(_repo.FullPath, changes).Exec());
|
||||
}
|
||||
_repo.MarkWorkingCopyDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
private async void UseExternalMergeTool(Models.Change change)
|
||||
{
|
||||
var toolType = Preference.Instance.ExternalMergeToolType;
|
||||
var toolPath = Preference.Instance.ExternalMergeToolPath;
|
||||
|
||||
_repo.SetWatcherEnabled(false);
|
||||
await Task.Run(() => Commands.MergeTool.OpenForMerge(_repo.FullPath, toolType, toolPath, change.Path));
|
||||
_repo.SetWatcherEnabled(true);
|
||||
}
|
||||
|
||||
private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty)
|
||||
{
|
||||
if (!PopupHost.CanCreatePopup())
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
HorizontalAlignment="Right"
|
||||
IsVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}">
|
||||
<Button Classes="flat primary"
|
||||
Width="80" Height="28"
|
||||
Width="100" Height="28"
|
||||
Padding="0"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
|
@ -85,7 +85,7 @@
|
|||
Click="OnPopupSure"
|
||||
HotKey="Enter"/>
|
||||
<Button Classes="flat"
|
||||
Width="80" Height="28"
|
||||
Width="100" Height="28"
|
||||
Margin="8,0,0,0"
|
||||
Padding="0"
|
||||
HorizontalContentAlignment="Center"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:m="using:SourceGit.Models"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
xmlns:c="using:SourceGit.Converters"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.Merge"
|
||||
x:DataType="vm:Merge">
|
||||
|
@ -11,7 +12,7 @@
|
|||
<TextBlock FontSize="18"
|
||||
Classes="bold"
|
||||
Text="{DynamicResource Text.Merge}"/>
|
||||
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32" ColumnDefinitions="150,*">
|
||||
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32" ColumnDefinitions="130,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"
|
||||
|
@ -25,6 +26,14 @@
|
|||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="m:Commit">
|
||||
<Grid ColumnDefinitions="Auto,Auto,*">
|
||||
<Path Grid.Column="0" Width="14" Height="14" Margin="0,8,0,0" Data="{StaticResource Icons.Commit}"/>
|
||||
<TextBlock Grid.Column="1" Classes="primary" VerticalAlignment="Center" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0"/>
|
||||
<TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding Subject}" Margin="4,0,0,0" TextTrimming="CharacterEllipsis"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="m:Tag">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Tag}"/>
|
||||
|
|
|
@ -547,7 +547,7 @@
|
|||
|
||||
<!-- Right -->
|
||||
<Grid Grid.Column="2" RowDefinitions="Auto,Auto,*">
|
||||
<Grid Grid.Row="0" Height="28" ColumnDefinitions="*,Auto,Auto" Background="{DynamicResource Brush.Conflict}" IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<Grid Grid.Row="0" Height="28" ColumnDefinitions="*,Auto" Background="{DynamicResource Brush.Conflict}" IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<ContentControl Grid.Column="0" Margin="8,0" Content="{Binding InProgressContext}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="m:Commit">
|
||||
|
@ -563,27 +563,39 @@
|
|||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:CherryPickInProgress">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.CherryPick}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.CherryPick.Head}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="DarkOrange" Text="{Binding Head.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" ToolTip.Tip="{Binding Head}"/>
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.CherryPick}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.CherryPick.Head}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="DarkOrange" Text="{Binding Head.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" ToolTip.Tip="{Binding Head}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Column="1" Classes="flat" FontWeight="Regular" BorderThickness="0" Content="{DynamicResource Text.Repository.Skip}" Padding="8,2" Click="OnSkipInProgress"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:RebaseInProgress">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Rebase}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Rebase.StoppedAt}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="DarkOrange" Text="{Binding StoppedAt.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" ToolTip.Tip="{Binding StoppedAt}"/>
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Rebase}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Rebase.StoppedAt}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="DarkOrange" Text="{Binding StoppedAt.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" ToolTip.Tip="{Binding StoppedAt}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Column="1" Classes="flat" FontWeight="Regular" BorderThickness="0" Content="{DynamicResource Text.Repository.Skip}" Padding="8,2" Click="OnSkipInProgress"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:RevertInProgress">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Revert}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Revert.Head}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="DarkOrange" Text="{Binding Head.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" ToolTip.Tip="{Binding Head}"/>
|
||||
</StackPanel>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Revert}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.ConflictForeground}" Text="{DynamicResource Text.InProgress.Revert.Head}"/>
|
||||
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Foreground="DarkOrange" Text="{Binding Head.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" ToolTip.Tip="{Binding Head}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Column="1" Classes="flat" FontWeight="Regular" BorderThickness="0" Content="{DynamicResource Text.Repository.Skip}" Padding="8,2" Click="OnSkipInProgress"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:MergeInProgress">
|
||||
|
@ -598,30 +610,12 @@
|
|||
</ContentControl.DataTemplates>
|
||||
</ContentControl>
|
||||
|
||||
<ContentControl Grid.Column="1" Margin="4,0" Content="{Binding InProgressContext}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="vm:CherryPickInProgress">
|
||||
<Button Classes="flat" FontWeight="Regular" BorderThickness="0" Content="{DynamicResource Text.Repository.Skip}" Padding="8,2" Command="{Binding Skip}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:RebaseInProgress">
|
||||
<Button Classes="flat" FontWeight="Regular" BorderThickness="0" Content="{DynamicResource Text.Repository.Skip}" Padding="8,2" Command="{Binding Skip}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:RevertInProgress">
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:MergeInProgress">
|
||||
</DataTemplate>
|
||||
</ContentControl.DataTemplates>
|
||||
</ContentControl>
|
||||
|
||||
<Button Grid.Column="2"
|
||||
<Button Grid.Column="1"
|
||||
Classes="flat"
|
||||
FontWeight="Regular"
|
||||
BorderThickness="0"
|
||||
Content="{DynamicResource Text.Repository.Abort}"
|
||||
Padding="8,2" Margin="4,0"
|
||||
Padding="8,2" Margin="0,0,8,0"
|
||||
Command="{Binding AbortMerge}"/>
|
||||
</Grid>
|
||||
|
||||
|
|
|
@ -428,5 +428,13 @@ namespace SourceGit.Views
|
|||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnSkipInProgress(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Repository repo)
|
||||
repo.SkipMerge();
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -719,19 +719,22 @@ namespace SourceGit.Views
|
|||
else if (change.Property == BlockNavigationProperty)
|
||||
{
|
||||
var oldValue = change.OldValue as ViewModels.BlockNavigation;
|
||||
var newValue = change.NewValue as ViewModels.BlockNavigation;
|
||||
if (oldValue != null)
|
||||
{
|
||||
oldValue.PropertyChanged -= OnBlockNavigationPropertyChanged;
|
||||
if (oldValue.Current != -1)
|
||||
TextArea?.TextView?.Redraw();
|
||||
}
|
||||
|
||||
var newValue = change.NewValue as ViewModels.BlockNavigation;
|
||||
if (newValue != null)
|
||||
newValue.PropertyChanged += OnBlockNavigationPropertyChanged;
|
||||
|
||||
InvalidateVisual();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBlockNavigationPropertyChanged(object _1, PropertyChangedEventArgs _2)
|
||||
{
|
||||
TextArea.TextView.Redraw();
|
||||
TextArea?.TextView?.Redraw();
|
||||
}
|
||||
|
||||
private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e)
|
||||
|
@ -1576,7 +1579,7 @@ namespace SourceGit.Views
|
|||
|
||||
UseBlockNavigationProperty.Changed.AddClassHandler<TextDiffView>((v, _) =>
|
||||
{
|
||||
v.RefreshContent(v.DataContext as Models.TextDiff, false);
|
||||
v.RefreshBlockNavigation();
|
||||
});
|
||||
|
||||
SelectedChunkProperty.Changed.AddClassHandler<TextDiffView>((v, _) =>
|
||||
|
@ -1664,6 +1667,14 @@ namespace SourceGit.Views
|
|||
Editor.Content = diff;
|
||||
}
|
||||
|
||||
RefreshBlockNavigation();
|
||||
|
||||
IsUnstagedChange = diff.Option.IsUnstaged;
|
||||
EnableChunkSelection = diff.Option.WorkingCopyChange != null;
|
||||
}
|
||||
|
||||
private void RefreshBlockNavigation()
|
||||
{
|
||||
if (UseBlockNavigation)
|
||||
{
|
||||
BlockNavigation = new ViewModels.BlockNavigation(Editor.Content);
|
||||
|
@ -1674,9 +1685,6 @@ namespace SourceGit.Views
|
|||
BlockNavigation = null;
|
||||
BlockNavigationIndicator = "-/-";
|
||||
}
|
||||
|
||||
IsUnstagedChange = diff.Option.IsUnstaged;
|
||||
EnableChunkSelection = diff.Option.WorkingCopyChange != null;
|
||||
}
|
||||
|
||||
private void OnStageChunk(object _1, RoutedEventArgs _2)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:m="using:SourceGit.Models"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
xmlns:v="using:SourceGit.Views"
|
||||
xmlns:c="using:SourceGit.Converters"
|
||||
|
@ -169,13 +170,67 @@
|
|||
|
||||
<ContentControl Content="{Binding DetailContext}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="vm:ConflictContext">
|
||||
<DataTemplate DataType="vm:Conflict">
|
||||
<Border Background="{DynamicResource Brush.Window}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
||||
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Grid VerticalAlignment="Center">
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding !IsResolved}">
|
||||
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}"/>
|
||||
<TextBlock Margin="0,16,0,8" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Text="{DynamicResource Text.WorkingCopy.ResolveTip}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
||||
<StackPanel.DataTemplates>
|
||||
<DataTemplate DataType="m:Branch">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<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 Head, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="m:Commit">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Path Width="12" Height="12" Margin="0,6,0,0" Data="{StaticResource Icons.Commit}"/>
|
||||
<v:CommitRefsPresenter Margin="8,0,0,0"
|
||||
TagBackground="{DynamicResource Brush.DecoratorTag}"
|
||||
Foreground="{DynamicResource Brush.FG1}"
|
||||
FontFamily="{DynamicResource Fonts.Primary}"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
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 Subject}"/>
|
||||
</StackPanel>
|
||||
</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>
|
||||
|
||||
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
||||
<TextBlock Margin="0,16" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
||||
|
||||
<Border Margin="16,0" Padding="8" CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
||||
<Border.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="Theirs" Converter="{x:Static ObjectConverters.IsNotNull}"/>
|
||||
<Binding Path="Mine" Converter="{x:Static ObjectConverters.IsNotNull}"/>
|
||||
</MultiBinding>
|
||||
</Border.IsVisible>
|
||||
|
||||
<Grid Margin="8,0,0,0" RowDefinitions="32,32" ColumnDefinitions="Auto,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Classes="info_label" Text="THEIRS"/>
|
||||
<ContentControl Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Content="{Binding Theirs}"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Classes="info_label" Text="MINE"/>
|
||||
<ContentControl Grid.Row="1" Grid.Column="1" Margin="16,0,0,0" Content="{Binding Mine}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<StackPanel Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Classes="flat" Content="USE THEIRS" Command="{Binding UseTheirs}"/>
|
||||
<Button Classes="flat" Margin="8,0,0,0" Content="USE MINE" Command="{Binding UseMine}"/>
|
||||
<Button Classes="flat" Margin="8,0,0,0" Content="OPEN EXTERNAL MERGETOOL" Command="{Binding OpenExternalMergeTool}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Vertical" IsVisible="{Binding IsResolved}">
|
||||
|
@ -300,8 +355,15 @@
|
|||
HotKey="Alt+Enter"
|
||||
ToolTip.Tip="{OnPlatform Alt+Enter, macOS=⌥+Enter}"
|
||||
ToolTip.Placement="Top"
|
||||
ToolTip.VerticalOffset="0"
|
||||
IsVisible="{Binding IsCommitWithPushVisible}"/>
|
||||
ToolTip.VerticalOffset="0">
|
||||
<Button.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="UseAmend" Converter="{x:Static BoolConverters.Not}"/>
|
||||
<Binding Path="CanCommitWithPush"/>
|
||||
<Binding Path="InProgressContext" Converter="{x:Static ObjectConverters.IsNull}"/>
|
||||
</MultiBinding>
|
||||
</Button.IsVisible>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in a new issue