Sune Foldager  committed 80d847f

revdetails: add "Copy Path" in pop-up menu

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

  • Participants
  • Parent commits 6a58c87
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/

               _('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'),
         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:
             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: