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

repomodel: calculate the width of author column

inspired by patch from David Wilhelm

Changeset dc514745b852

Parent b7bf8a5a8e32

by Steve Borho

Changes to one file · Browse files at dc514745b852 Showing diff from parent b7bf8a5a8e32 Diff from another changeset...

 
169
170
171
 
172
173
174
 
230
231
232
 
 
 
 
 
 
 
 
 
 
233
234
235
 
258
259
260
261
 
262
263
264
 
169
170
171
172
173
174
175
 
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
 
269
270
271
 
272
273
274
275
@@ -169,6 +169,7 @@
  self.max_file_size = 1024*1024 # will be removed   self.authorcolor = self.repo.ui.configbool('tortoisehg', 'authorcolor')   self.updateColumns() + self.maxauthor = 'author name'     def updateColumns(self):   s = QSettings() @@ -230,6 +231,16 @@
  def updateRowCount(self):   currentlen = self.rowcount   newlen = len(self.graph) + + # This is not fast; the graph walker should do this, or only do + # it when the user asks for a resize. + authors = set() + for i in xrange(currentlen, newlen): + authors.add(self.repo[self.graph.nodes[i].rev].user()) + sauthors = [templatefilters.person(user) for user in list(authors)] + sauthors.append(self.maxauthor) + self.maxauthor = sorted(sauthors, key=lambda x: len(x))[-1] +   if newlen > self.rowcount:   self.beginInsertRows(QModelIndex(), currentlen, newlen-1)   self.rowcount = newlen @@ -258,7 +269,7 @@
  except IndexError:   pass   if column == 'Author': - return 'author name' # TODO get actual max + return self.maxauthor   if column == 'Filename':   return self.filename   if column == 'Graph':