changeset: copy hash to clipboard is now optional, default: False 0.4rc2
authorSteve Borho <steve@borho.org>
Sat, 03 May 2008 11:19:11 -0500
changeset 1153 e677decc9814
parent 1152 68a01cdebb39
child 1154 4d6880646a66
changeset: copy hash to clipboard is now optional, default: False
hggtk/changeset.py
hggtk/thgconfig.py
--- a/hggtk/changeset.py	Sun Apr 27 05:55:53 2008 +0100
+++ b/hggtk/changeset.py	Sat May 03 11:19:11 2008 -0500
@@ -121,7 +121,8 @@
         # TODO: Add toggle for gmtime/localtime
         eob = buf.get_end_iter()
         date = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(ctx.date()[0]))
-        self.clipboard.set_text(short(ctx.node()))
+        if self.clipboard:
+            self.clipboard.set_text(short(ctx.node()))
         change = str(rev) + ':' + short(ctx.node())
         tags = ' '.join(ctx.tags())
         parents = self.parents
@@ -468,8 +469,11 @@
         return _menu
 
     def get_body(self):
-        sel = (os.name == 'nt') and 'CLIPBOARD' or 'PRIMARY'
-        self.clipboard = gtk.Clipboard(selection=sel)
+        if self.repo.ui.configbool('tortoisehg', 'copyhash'):
+            sel = (os.name == 'nt') and 'CLIPBOARD' or 'PRIMARY'
+            self.clipboard = gtk.Clipboard(selection=sel)
+        else:
+            self.clipboard = None
         self._filemenu = self.file_context_menu()
 
         details_frame = gtk.Frame()
--- a/hggtk/thgconfig.py	Sun Apr 27 05:55:53 2008 +0100
+++ b/hggtk/thgconfig.py	Sat May 03 11:19:11 2008 -0500
@@ -87,6 +87,9 @@
                 ('Log Batch Size', 'tortoisehg.graphlimit', ['500'],
                     'The number of revisions to read and display in the'
                     ' changelog viewer in a single batch. Default: 500'),
+                ('Copy Hash', 'tortoisehg.copyhash', ['False', 'True'],
+                    'Allow the changelog viewer to copy hash of currently'
+                    ' selected changeset into the clipboard. Default: False'),
                 ('Overlay Icons', 'tortoisehg.overlayicons',
                     ['False', 'True', 'localdisks'],
                     'Display overlay icons in Explorer windows.'