Commits

Angel Ezquerra  committed 5572e41

commit, manifest: "edit" clean and untracked files when they are double clicked

Previosly double clicking on a clean or an untracked file on the status widget
would do nothing, while double clicking on one of those on the manifest widget
would try to diff it, resulting on a "No file changes" dialog being shown.

With this change the file will be open on the configured Visual Editor instead.

  • Participants
  • Parent commits f08b3df
  • Branches stable

Comments (0)

Files changed (3)

File tortoisehg/hgqt/manifestdialog.py

         if itemissubrepo:
             self.opensubrepo()
         else:
-            self.vdiff()
+            if self._treemodel.fileStatus(index) in 'C?':
+                self.editfile()
+            else:
+                self.vdiff()
 
     def menuRequest(self, point):
         selmodel = self._treeview.selectionModel()

File tortoisehg/hgqt/revdetails.py

     #@pyqtSlot(QModelIndex)
     def onDoubleClick(self, index):
         model = self.filelist.model()
-        itemissubrepo = (model.dataFromIndex(index)['status'] == 'S')
+        itemstatus = model.dataFromIndex(index)['status']
+        itemissubrepo = (itemstatus == 'S')
         if itemissubrepo:
             self.opensubrepo()
+        elif itemstatus == 'C':
+            self.editfile()
         else:
             self.vdiff()
 

File tortoisehg/hgqt/status.py

         elif status == 'S':
             self.linkActivated.emit(
                 u'subrepo:' + hglib.tounicode(self.repo.wjoin(path)))
+        elif status in 'C?':
+            qtlib.editfiles(self.repo, [path])
 
     @pyqtSlot(QString)
     def setFilter(self, match):