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

stable filelistview: do not clear 'Show All' toggle when displaying non-merge ctx

Changeset ee45228c8376

Parent d7700ee69b6d

by Steve Borho

Changes to 2 files · Browse files at ee45228c8376 Showing diff from parent d7700ee69b6d Diff from another changeset...

 
23
24
25
26
27
28
29
30
31
 
84
85
86
87
 
88
89
90
 
105
106
107
108
 
109
110
111
 
121
122
123
124
 
125
126
127
128
129
 
 
 
130
131
132
 
142
143
144
145
 
146
147
148
 
155
156
157
158
 
159
160
161
 
23
24
25
 
 
 
26
27
28
 
81
82
83
 
84
85
86
87
 
102
103
104
 
105
106
107
108
 
118
119
120
 
121
122
123
124
125
126
127
128
129
130
131
132
 
142
143
144
 
145
146
147
148
 
155
156
157
 
158
159
160
161
@@ -23,9 +23,6 @@
   nullvariant = QVariant()   -def ismerge(ctx): - return len(ctx.parents()) > 1 -  class HgFileListModel(QAbstractTableModel):   """   Model used for listing (modified) files of a given Hg revision @@ -84,7 +81,7 @@
  return self._files[row]['path']     def revFromIndex(self, index): - if self._fulllist and ismerge(self._ctx): + if self.showingFullList():   if not index.isValid() or index.row()>=len(self) or not self._ctx:   return None   row = index.row() @@ -105,7 +102,7 @@
  files = []   ctxfiles = self._ctx.files()   modified, added, removed = self._ctx.changesToParent(parent) - if self._fulllist: + if self.showingFullList():   func = lambda x: True   else:   func = lambda x: x in ctxfiles @@ -121,12 +118,15 @@
  def loadFiles(self):   self._files = []   self._files = self._buildDesc(0) - if ismerge(self._ctx): + if bool(self._ctx.p2()):   _paths = [x['path'] for x in self._files]   _files = self._buildDesc(1)   self._files += [x for x in _files if x['path'] not in _paths]   self._filesdict = dict([(f['path'], f) for f in self._files])   + def showingFullList(self): + return self._fulllist and bool(self._ctx.p2()) +   def data(self, index, role):   if not index.isValid() or index.row()>len(self) or not self._ctx:   return nullvariant @@ -142,7 +142,7 @@
  if role in (Qt.DisplayRole, Qt.ToolTipRole):   return QVariant(hglib.tounicode(current_file))   elif role == Qt.DecorationRole: - if self._fulllist and ismerge(self._ctx): + if self.showingFullList():   if current_file_desc['infiles']:   icn = geticon('leftright')   elif current_file_desc['parent'] == 0: @@ -155,7 +155,7 @@
  elif current_file_desc['flag'] == 'R':   return QVariant(geticon('filedelete'))   elif role == Qt.FontRole: - if self._fulllist and current_file_desc['infiles']: + if current_file_desc['infiles'] and self.showingFullList():   return QVariant(self._boldfont)   else:   return nullvariant
 
72
73
74
75
76
77
78
 
72
73
74
 
75
76
77
@@ -72,7 +72,6 @@
  self.actionShowAllMerge.setVisible(True)   else:   self.actionShowAllMerge.setVisible(False) - self.actionShowAllMerge.setChecked(False)     def currentFile(self):   index = self.currentIndex()