# HG changeset patch
# User Sune Foldager <c...@cyanite.org>
# Date 1321537162 -3600
# Node ID 3a37173bb96165f91f820910039835f0f87b7dae
# Parent  3ad0d7fc51750144ae26474b03d7aa64959d29cb
revdetails: add "Copy Path" in pop-up menu

Similar to the "Copy path" item in the pop-up menu for working directory files.

diff -r 3ad0d7fc5175 -r 3a37173bb961 tortoisehg/hgqt/revdetails.py
--- a/tortoisehg/hgqt/revdetails.py     Thu Nov 17 13:41:12 2011 +0100
+++ b/tortoisehg/hgqt/revdetails.py     Thu Nov 17 14:39:22 2011 +0100
@@ -240,6 +240,9 @@
               _('Edit current file in working copy'), self.editlocal),
             ('lopen', _('Open Local'), '', 'Shift+Ctrl+O',
               _('Edit current file in working copy'), self.openlocal),
+            ('copypath', _('Copy Path'), '', 'Shift+Ctrl+C',
+              _('Copy full path of file(s) to the clipboard'),
+              self.copypath),
             ('revert', _('Revert to Revision'), 'hg-revert', 'Alt+Ctrl+T',
               _('Revert file(s) to contents at this revision'),
               self.revertfile),
@@ -375,6 +378,11 @@
             return
         qtlib.openfiles(self.repo, filenames)
 
+    def copypath(self):
+        absfiles = [util.localpath(self.repo.wjoin(hglib.fromunicode(f)))
+                    for f in self.filelist.getSelectedFiles()]
+        QApplication.clipboard().setText(os.linesep.join(absfiles))
+
     def revertfile(self):
         fileSelection = self.filelist.getSelectedFiles()
         if len(fileSelection) == 0:
@@ -451,7 +459,7 @@
         else:
             contextmenu = self.filecontextmenu
             actionlist = ['diff', 'ldiff', None, 'edit', 'save', None,
-                            'ledit', 'lopen', None, 'revert', None,
+                            'ledit', 'lopen', 'copypath', None, 'revert', None,
                             'navigate', 'diffnavigate']
 
         if not contextmenu:

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to