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

repomodel: improve maxWidthValueForColumn()

Should not blow chunks in an empty repo

Changeset 7703162dc42c

Parent c6f794013f01

by Steve Borho

Changes to one file · Browse files at 7703162dc42c Showing diff from parent c6f794013f01 Diff from another changeset...

 
89
90
91
92
93
 
 
94
95
96
 
256
257
258
259
260
 
 
 
 
 
261
262
263
 
89
90
91
 
 
92
93
94
95
96
 
256
257
258
 
 
259
260
261
262
263
264
265
266
@@ -89,8 +89,8 @@
  }    # in following lambdas, r is a hg repo -_maxwidth = {'ID': lambda self, r: str(len(r.changelog)), - 'Date': lambda self, r: cvrt_date(r.changectx(0).date()), +_maxwidth = {'ID': lambda self, r: str(len(r)), + 'Date': lambda self, r: cvrt_date(r[None].date()),   'Tags': lambda self, r: sorted(r.tags().keys(),   key=lambda x: len(x))[-1][:10],   'Branch': lambda self, r: sorted(r.branchtags().keys(), @@ -256,8 +256,11 @@
    def maxWidthValueForColumn(self, column):   column = self._columns[column] - if column in _maxwidth: - return _maxwidth[column](self, self.repo) + try: + if column in _maxwidth: + return _maxwidth[column](self, self.repo) + except IndexError: + pass   return None     def user_color(self, user):