Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

repoview: add "Copy Hash" context menu item

Changeset 735affe269e2

Parent 97cb9c42da42

by David Wilhelm

Changes to 2 files · Browse files at 735affe269e2 Showing diff from parent 97cb9c42da42 Diff from another changeset...

 
122
123
124
125
 
 
126
127
128
 
163
164
165
 
 
 
166
167
168
169
 
170
171
172
 
122
123
124
 
125
126
127
128
129
 
164
165
166
167
168
169
170
171
172
 
173
174
175
176
@@ -122,7 +122,8 @@
  self.backoutToRev),   ('email', _('Email patch...'), None, None, None,   self.emailRev), - + ('copyhash', _('Copy hash'), None, None, None, + self.copyHash),   ]   return a   @@ -163,10 +164,13 @@
  def emailRev(self):   self.emit(SIGNAL('emailRevision'), self.current_rev)   + def copyHash(self): + self.emit(SIGNAL('copyHash'), self.current_rev) +   def contextMenuEvent(self, event):   menu = QMenu(self)   for act in ['update', 'manifest', 'merge', 'tag', 'backout', - 'email', None, 'back', 'forward']: + 'email', 'copyhash', None, 'back', 'forward']:   if act:   menu.addAction(self._actions[act])   else:
 
8
9
10
 
11
12
13
 
173
174
175
 
176
177
178
 
249
250
251
 
 
 
 
252
253
254
 
8
9
10
11
12
13
14
 
174
175
176
177
178
179
180
 
251
252
253
254
255
256
257
258
259
260
@@ -8,6 +8,7 @@
 # This software may be used and distributed according to the terms  # of the GNU General Public License, incorporated herein by reference.   +import binascii  import os    from mercurial import hg @@ -173,6 +174,7 @@
  connect(view, SIGNAL('tagToRevision'), self.tagToRevision)   connect(view, SIGNAL('backoutToRevision'), self.backoutToRevision)   connect(view, SIGNAL('emailRevision'), self.emailRevision) + connect(view, SIGNAL('copyHash'), self.copyHash)   #self.attachQuickBar(view.goto_toolbar)   gotoaction = view.goto_toolbar.toggleViewAction()   gotoaction.setIcon(geticon('goto')) @@ -249,6 +251,10 @@
  dlg = hgemail.EmailDialog(self.repo.ui, self.repo, [str(rev)], self)   dlg.show()   + def copyHash(self, rev): + clip = QApplication.clipboard() + clip.setText(binascii.hexlify(self.repo[rev].node())) +   def revision_selected(self, rev):   if self.repomodel.graph:   ctx = self.repomodel.repo.changectx(rev)