/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to annotate/gannotate.py

  • Committer: Jelmer Vernooij
  • Date: 2006-09-05 02:17:19 UTC
  • Revision ID: jelmer@samba.org-20060905021719-90e2eda34c41604b
Handle empty files more gracefully. Fixes #58951.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
            # bar?
115
115
            print("gannotate: Line number %d does't exist. Defaulting to "
116
116
                  "line 1." % lineno)
 
117
            return
117
118
        else:
118
119
            row = lineno - 1
119
120
 
145
146
 
146
147
    def _set_oldest_newest(self):
147
148
        rev_dates = map(lambda i: self.revisions[i].timestamp, self.revisions)
 
149
        if len(rev_dates) == 0:
 
150
            return
148
151
        oldest = min(rev_dates)
149
152
        newest = max(rev_dates)
150
153
 
170
173
 
171
174
    def _show_log(self, w):
172
175
        (path, col) = self.annoview.get_cursor()
 
176
        if path is None:
 
177
            return
173
178
        rev_id = self.annomodel[path][REVISION_ID_COL]
174
179
        self.logview.set_revision(self.revisions[rev_id])
175
180