mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
feature(WorkingCopy): add context menu entry to view histories from selected unstaged change
This commit is contained in:
parent
5fa2c601a8
commit
e00799555f
2 changed files with 22 additions and 1 deletions
|
@ -474,7 +474,6 @@ namespace SourceGit.Git {
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
OnSubmoduleChanged?.Invoke();
|
OnSubmoduleChanged?.Invoke();
|
||||||
|
|
||||||
AssertCommand(errs);
|
AssertCommand(errs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,6 +282,17 @@ namespace SourceGit.UI {
|
||||||
menu.Items.Add(stash);
|
menu.Items.Add(stash);
|
||||||
menu.Items.Add(patch);
|
menu.Items.Add(patch);
|
||||||
menu.Items.Add(new Separator());
|
menu.Items.Add(new Separator());
|
||||||
|
if (node.Change != null) {
|
||||||
|
var history = new MenuItem();
|
||||||
|
history.Header = "Histories ...";
|
||||||
|
history.Click += (o, e) => {
|
||||||
|
var viewer = new FileHistories(Repo, node.FilePath);
|
||||||
|
viewer.Show();
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
menu.Items.Add(history);
|
||||||
|
menu.Items.Add(new Separator());
|
||||||
|
}
|
||||||
menu.Items.Add(copyPath);
|
menu.Items.Add(copyPath);
|
||||||
menu.IsOpen = true;
|
menu.IsOpen = true;
|
||||||
} else if (selected.Count > 1) {
|
} else if (selected.Count > 1) {
|
||||||
|
@ -413,6 +424,17 @@ namespace SourceGit.UI {
|
||||||
menu.Items.Add(stash);
|
menu.Items.Add(stash);
|
||||||
menu.Items.Add(patch);
|
menu.Items.Add(patch);
|
||||||
menu.Items.Add(new Separator());
|
menu.Items.Add(new Separator());
|
||||||
|
if (change != null) {
|
||||||
|
var history = new MenuItem();
|
||||||
|
history.Header = "Histories ...";
|
||||||
|
history.Click += (o, e) => {
|
||||||
|
var viewer = new FileHistories(Repo, change.Path);
|
||||||
|
viewer.Show();
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
menu.Items.Add(history);
|
||||||
|
menu.Items.Add(new Separator());
|
||||||
|
}
|
||||||
menu.Items.Add(copyPath);
|
menu.Items.Add(copyPath);
|
||||||
menu.IsOpen = true;
|
menu.IsOpen = true;
|
||||||
} else if (selected.Count > 1) {
|
} else if (selected.Count > 1) {
|
||||||
|
|
Loading…
Reference in a new issue