Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion gitfourchette/graphview/graphview.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def __init__(self, repoModel: RepoModel, parent):
self.copyHashShortcut = makeWidgetShortcut(self, self.copyCommitHashToClipboard, QKeySequence.StandardKey.Copy)
self.copyMessageShortcut = makeWidgetShortcut(self, self.copyCommitMessageToClipboard, "Ctrl+Shift+C")
self.getInfoShortcut = makeWidgetShortcut(self, self.getInfoOnCurrentCommit, "Space")
self.tagCommitShortcut = makeWidgetShortcut(self, self.tagCurrentCommit, "Alt+T")

def mouseMoveEvent(self, event: QMouseEvent):
"""
Expand Down Expand Up @@ -163,6 +164,12 @@ def getInfoOnCurrentCommit(self):
withDebugInfo = QGuiApplication.keyboardModifiers() & (Qt.KeyboardModifier.AltModifier | Qt.KeyboardModifier.ShiftModifier)
GetCommitInfo.invoke(self, oid, withDebugInfo)

def tagCurrentCommit(self):
oid = self.currentCommitId
if not oid:
return
NewTag.invoke(self, oid)

def copyCommitHashToClipboard(self):
oid = self.currentCommitId
if not oid: # uncommitted changes
Expand Down Expand Up @@ -475,7 +482,7 @@ def _contextMenuActions1Commit(self):

actions = [
TaskBook.action(self, NewBranchFromCommit, _("New &Branch Here…"), taskArgs=oid),
TaskBook.action(self, NewTag, _("&Tag This Commit…"), taskArgs=oid),
TaskBook.action(self, NewTag, _("&Tag This Commit…"), taskArgs=oid, shortcuts=self.tagCommitShortcut.key()),
ActionDef.SEPARATOR,
checkoutAction,
TaskBook.action(self, MergeBranch, _("&Merge into {0}…", myRef), taskArgs=(mergeWhat,)),
Expand Down