Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit d938c4f

Browse files
donokudaStanleyGoldman
authored andcommitted
Stub out a context menu option for reverting commits
1 parent de6b7be commit d938c4f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,11 @@ private void CullHistory()
548548
EntryHeight + 1, 0, history.Count);
549549
}
550550

551+
private void RevertCommit()
552+
{
553+
Debug.Log("Hello from RevertCommit();");
554+
}
555+
551556
private bool HistoryEntry(GitLogEntry entry, LogEntryState state, bool selected)
552557
{
553558
var entryRect = GUILayoutUtility.GetRect(Styles.HistoryEntryHeight, Styles.HistoryEntryHeight);
@@ -611,6 +616,14 @@ private bool HistoryEntry(GitLogEntry entry, LogEntryState state, bool selected)
611616
GUI.DrawTexture(normalIndicatorRect, Styles.DotIcon);
612617
}
613618
}
619+
else if (Event.current.type == EventType.ContextClick && entryRect.Contains(Event.current.mousePosition))
620+
{
621+
GenericMenu menu = new GenericMenu();
622+
menu.AddItem(new GUIContent("Revert"), false, RevertCommit);
623+
menu.ShowAsContext();
624+
625+
Event.current.Use();
626+
}
614627
else if (Event.current.type == EventType.MouseDown && entryRect.Contains(Event.current.mousePosition))
615628
{
616629
Event.current.Use();

0 commit comments

Comments
 (0)