/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: Mateusz Korniak
  • Date: 2007-09-02 15:42:18 UTC
  • mto: This revision was merged to the branch mainline in revision 274.
  • Revision ID: matkor@laptop-hp-20070902154218-nba0woaqjsn20f9n
Ignoring eric3 project files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from colormap import AnnotateColorMap, AnnotateColorSaturation
31
31
from bzrlib.plugins.gtk.logview import LogView
32
 
from bzrlib.plugins.gtk.window import Window
33
32
 
34
33
 
35
34
(
42
41
) = range(6)
43
42
 
44
43
 
45
 
class GAnnotateWindow(Window):
 
44
class GAnnotateWindow(gtk.Window):
46
45
    """Annotate window."""
47
46
 
48
 
    def __init__(self, all=False, plain=False, parent=None):
 
47
    def __init__(self, all=False, plain=False):
49
48
        self.all = all
50
49
        self.plain = plain
51
50
        
52
 
        Window.__init__(self, parent)
 
51
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
53
52
        
54
53
        self.set_icon(self.render_icon(gtk.STOCK_FIND, gtk.ICON_SIZE_BUTTON))
55
54
        self.annotate_colormap = AnnotateColorSaturation()
82
81
            for line_no, (revision, revno, line)\
83
82
                    in enumerate(self._annotate(tree, file_id)):
84
83
                if revision.revision_id == last_seen and not self.all:
85
 
                    revno = author = ""
 
84
                    revno = committer = ""
86
85
                else:
87
86
                    last_seen = revision.revision_id
88
 
                    author = revision.get_apparent_author()
 
87
                    committer = revision.properties.get('author',
 
88
                        revision.committer)
89
89
 
90
90
                if revision.revision_id not in self.revisions:
91
91
                    self.revisions[revision.revision_id] = revision
92
92
 
93
93
                self.annomodel.append([revision.revision_id,
94
94
                                       line_no + 1,
95
 
                                       author,
 
95
                                       committer,
96
96
                                       revno,
97
97
                                       None,
98
98
                                       line.rstrip("\r\n")
393
393
                return j - i
394
394
 
395
395
 
 
396
 
396
397
class FakeRevision:
397
398
    """ A fake revision.
398
399
 
408
409
        self.timezone = 0
409
410
        self.properties = {}
410
411
 
411
 
    def get_apparent_author(self):
412
 
        return self.committer
413
 
 
414
412
 
415
413
class RevisionCache(object):
416
414
    """A caching revision source"""