mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 05:35:00 +00:00
refactor<*>: rewrite all codes...
This commit is contained in:
parent
89ff8aa744
commit
30ab8ae954
342 changed files with 17208 additions and 19633 deletions
48
src/Views/Popups/Rebase.xaml.cs
Normal file
48
src/Views/Popups/Rebase.xaml.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace SourceGit.Views.Popups {
|
||||
/// <summary>
|
||||
/// 变基操作面板
|
||||
/// </summary>
|
||||
public partial class Rebase : Controls.PopupWidget {
|
||||
private string repo = null;
|
||||
private string on = null;
|
||||
|
||||
public Rebase(string repo, string current, Models.Branch branch) {
|
||||
this.repo = repo;
|
||||
this.on = branch.Head;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
txtCurrent.Text = current;
|
||||
txtOn.Text = !string.IsNullOrEmpty(branch.Remote) ? $"{branch.Remote}/{branch.Name}" : branch.Name;
|
||||
iconBased.Data = FindResource("Icon.Branch") as Geometry;
|
||||
}
|
||||
|
||||
public Rebase(string repo, string current, Models.Commit commit) {
|
||||
this.repo = repo;
|
||||
this.on = commit.SHA;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
txtCurrent.Text = current;
|
||||
txtOn.Text = $"{commit.ShortSHA} {commit.Subject}";
|
||||
iconBased.Data = FindResource("Icon.Branch") as Geometry;
|
||||
}
|
||||
|
||||
public override string GetTitle() {
|
||||
return App.Text("Rebase");
|
||||
}
|
||||
|
||||
public override Task<bool> Start() {
|
||||
var autoStash = chkAutoStash.IsChecked == true;
|
||||
return Task.Run(() => {
|
||||
Models.Watcher.SetEnabled(repo, false);
|
||||
new Commands.Rebase(repo, on, autoStash).Exec();
|
||||
Models.Watcher.SetEnabled(repo, true);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue