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

revdetails: create a 'show all' action for merge changesets

The action behavior is currently broken, it somehow jumps to the merge parent.
Also removed unused revdetails.actionActivateFile

Changeset b256a167a674

Parent 105be55e034a

by Steve Borho

Changes to 3 files · Browse files at b256a167a674 Showing diff from parent 105be55e034a Diff from another changeset...

 
33
34
35
36
 
37
38
39
40
41
 
 
42
43
44
45
46
47
48
 
 
 
49
50
51
 
153
154
155
156
157
158
 
159
160
 
33
34
35
 
36
37
38
39
40
41
42
43
44
45
46
47
48
 
 
49
50
51
52
53
54
 
156
157
158
 
 
 
159
160
161
@@ -33,19 +33,22 @@
    contextChanged = pyqtSignal(object)   - def __init__(self, repo, parent=None): + def __init__(self, repo, parent):   """   data is a HgHLRepo instance   """   QAbstractTableModel.__init__(self, parent)   self.repo = repo + self._boldfont = parent.font() + self._boldfont.setBold(True)   self._ctx = None   self._files = []   self._filesdict = {}   self._fulllist = False   - def toggleFullFileList(self): - self._fulllist = not self._fulllist + @pyqtSlot(bool) + def toggleFullFileList(self, value): + self._fulllist = value   self.loadFiles()   self.layoutChanged.emit()   @@ -153,8 +156,6 @@
  return QVariant(geticon('filedelete'))   elif role == Qt.FontRole:   if self._fulllist and current_file_desc['infiles']: - font = self.font() - font.setBold(True) - return QVariant(font) + return QVariant(self._boldfont)   else:   return nullvariant
 
56
57
58
 
 
59
60
61
 
66
67
68
 
69
70
71
 
187
188
189
 
 
 
 
 
190
191
192
 
285
286
287
288
 
56
57
58
59
60
61
62
63
 
68
69
70
71
72
73
74
 
190
191
192
193
194
195
196
197
198
199
200
 
293
294
295
 
@@ -56,6 +56,8 @@
  model.contextChanged.connect(self.contextChanged)   self.selectionModel().currentRowChanged.connect(self.fileSelected)   self.horizontalHeader().setResizeMode(1, QHeaderView.Stretch) + self.actionShowAllMerge.setChecked(False) + self.actionShowAllMerge.toggled.connect(model.toggleFullFileList)   if model._ctx is not None:   self.contextChanged(model._ctx)   @@ -66,6 +68,7 @@
  self._actions[act].setEnabled(real)   for act in ['diff', 'revert']:   self._actions[act].setEnabled(real or wd) + self.actionShowAllMerge.setVisible(len(ctx.parents()) == 2)     def currentFile(self):   index = self.currentIndex() @@ -187,6 +190,11 @@
  dlg.activateWindow()     def createActions(self): + self.actionShowAllMerge = QAction('Show All', self) + self.actionShowAllMerge.setCheckable(True) + self.actionShowAllMerge.setChecked(False) + self.actionShowAllMerge.setVisible(False) +   self._actions = {}   for name, desc, icon, key, tip, cb in [   ('navigate', _('File history'), None, 'Shift+Return', @@ -285,4 +293,3 @@
  return QTableView.mouseMoveEvent(self, event)   self.dragObject()   return QTableView.mouseMoveEvent(self, event) -
 
177
178
179
180
181
 
 
 
182
183
184
185
186
187
188
 
 
189
190
191
 
204
205
206
207
 
208
209
210
 
177
178
179
 
 
180
181
182
183
184
185
 
 
 
 
186
187
188
189
190
 
203
204
205
 
206
207
208
209
@@ -177,15 +177,14 @@
  self.filelist.clearDisplay.connect(self.fileview.clearDisplay)     def createActions(self): - # Activate file (file diff navigator) - self.actionActivateFile = QAction('Activate file', self) + def fileActivated(): + idx = self.filelist.currentIndex() + self.filelist.fileActivated(idx, alternate=True)   self.actionActivateFileAlt = QAction('Activate alt. file', self)   self.actionActivateFileAlt.setShortcuts([Qt.ALT+Qt.Key_Return,   Qt.ALT+Qt.Key_Enter]) - self.actionActivateFileAlt.triggered.connect( - lambda self=self: - self.filelist.fileActivated(self.filelist.currentIndex(), - alternate=True)) + self.actionActivateFileAlt.triggered.connect(fileActivated) + self.mergeToolBar.addAction(self.filelist.actionShowAllMerge)     @pyqtSlot()   def toggleSearchBar(self): @@ -204,7 +203,7 @@
  self.searchbar.caseInsensitive())     def create_models(self): - self.filelistmodel = HgFileListModel(self.repo, parent=self) + self.filelistmodel = HgFileListModel(self.repo, self)     def setupModels(self):   self.create_models()