[Pkg-bazaar-commits] ./bzr-gtk/unstable r79: Handle empty files more gracefully. Fixes #58951.
Jelmer Vernooij
jelmer at samba.org
Fri Apr 10 07:49:05 UTC 2009
------------------------------------------------------------
revno: 79
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-gtk
timestamp: Tue 2006-09-05 04:17:19 +0200
message:
Handle empty files more gracefully. Fixes #58951.
modified:
annotate/gannotate.py
-------------- next part --------------
=== modified file 'annotate/gannotate.py'
--- a/annotate/gannotate.py 2006-06-19 23:12:15 +0000
+++ b/annotate/gannotate.py 2006-09-05 02:17:19 +0000
@@ -114,6 +114,7 @@
# bar?
print("gannotate: Line number %d does't exist. Defaulting to "
"line 1." % lineno)
+ return
else:
row = lineno - 1
@@ -145,6 +146,8 @@
def _set_oldest_newest(self):
rev_dates = map(lambda i: self.revisions[i].timestamp, self.revisions)
+ if len(rev_dates) == 0:
+ return
oldest = min(rev_dates)
newest = max(rev_dates)
@@ -170,6 +173,8 @@
def _show_log(self, w):
(path, col) = self.annoview.get_cursor()
+ if path is None:
+ return
rev_id = self.annomodel[path][REVISION_ID_COL]
self.logview.set_revision(self.revisions[rev_id])
More information about the Pkg-bazaar-commits
mailing list