# HG changeset patch
# User Steve Borho <
st...@borho.org>
# Date 1624898843 18000
# Mon Jun 28 11:47:23 2021 -0500
# Node ID 85d79894cb6b82f4e6136190f141e53c5bc0b412
# Parent c2bde63d7559abba0a2ccbe82ef3ccc13cb2d9f4
allow hash-copy to clipboard to be configured; change default to off
I've long found this behavior irritating; my clipboard is important to my
workflow. In those instances where I want a hash, I will copy it out of the rev
details or use the context menu
diff -r c2bde63d7559 -r 85d79894cb6b tortoisehg/hgqt/repoview.py
--- a/tortoisehg/hgqt/repoview.py Fri Jul 09 19:05:11 2021 +0900
+++ b/tortoisehg/hgqt/repoview.py Mon Jun 28 11:47:23 2021 -0500
@@ -131,7 +131,8 @@
self.setSelectionBehavior(QAbstractItemView.SelectRows)
self.doubleClicked.connect(self.revActivated)
- self.clicked.connect(self.revClicked)
+ if repoagent.configBool('tortoisehg', 'copy_hash_selection'):
+ self.clicked.connect(self._copyHashToSelection)
@property
def repo(self):
@@ -321,7 +322,7 @@
def context(self, rev):
return self.repo[rev]
- def revClicked(self, index):
+ def _copyHashToSelection(self, index):
rev = self.revFromindex(index)
if rev is not None:
clip = QApplication.clipboard()
diff -r c2bde63d7559 -r 85d79894cb6b tortoisehg/hgqt/settings.py
--- a/tortoisehg/hgqt/settings.py Fri Jul 09 19:05:11 2021 +0900
+++ b/tortoisehg/hgqt/settings.py Mon Jun 28 11:47:23 2021 -0500
@@ -823,6 +823,10 @@
'<b>Note</b>: This layouter colors edges using branch information '
'and does not display graft edges, regardless of whether they are '
'requested or not.')),
+ _fi(_('Copy Hash to Selection'), 'tortoisehg.copy_hash_selection',
+ genBoolRBGroup,
+ _('When a revision is selected in Workbench, copy hash to primary '
+ 'selection clipboard (X11). Default: False')),
)),
({'name': 'commit', 'label': _('Commit', 'config item'), 'icon': 'hg-commit'},
(