Commits

Steve Borho  committed e677dec

changeset: copy hash to clipboard is now optional, default: False

  • Participants
  • Parent commits 68a01cd
  • Tags 0.4rc2

Comments (0)

Files changed (2)

File hggtk/changeset.py

         # 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
         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()

File hggtk/thgconfig.py

                 ('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.'