/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 gannotate.py

  • Committer: Aaron Bentley
  • Date: 2006-03-20 14:07:43 UTC
  • mfrom: (0.4.1 gannotate)
  • mto: This revision was merged to the branch mainline in revision 49.
  • Revision ID: abentley@panoramicfeedback.com-20060320140743-c0e744f040f51301
MergeĀ otherĀ changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
                                       gobject.TYPE_STRING)
69
69
        
70
70
        last_seen = None
71
 
        for line_no, (revision, revno, line)\
72
 
                in enumerate(self._annotate(branch, file_id)):
73
 
            if revision.revision_id == last_seen and not self.all:
74
 
                revno = committer = ""
75
 
            else:
76
 
                last_seen = revision.revision_id
77
 
                committer = revision.committer
78
 
 
79
 
            if revision.revision_id not in self.revisions:
80
 
                self.revisions[revision.revision_id] = revision
81
 
 
82
 
            self.annomodel.append([revision.revision_id,
83
 
                                   line_no + 1,
84
 
                                   committer,
85
 
                                   revno,
86
 
                                   None,
87
 
                                   line.rstrip("\r\n")
88
 
                                  ])
89
 
 
90
 
        if not self.plain:
91
 
            self._set_oldest_newest()
92
 
            # Recall that calling activate_default will emit "span-changed",
93
 
            # so self._span_changed_cb will take care of initial highlighting
94
 
            self.span_selector.activate_default()
 
71
        try:
 
72
            branch.lock_read()
 
73
            branch.repository.lock_read()
 
74
            for line_no, (revision, revno, line)\
 
75
                    in enumerate(self._annotate(branch, file_id)):
 
76
                if revision.revision_id == last_seen and not self.all:
 
77
                    revno = committer = ""
 
78
                else:
 
79
                    last_seen = revision.revision_id
 
80
                    committer = revision.committer
 
81
 
 
82
                if revision.revision_id not in self.revisions:
 
83
                    self.revisions[revision.revision_id] = revision
 
84
 
 
85
                self.annomodel.append([revision.revision_id,
 
86
                                       line_no + 1,
 
87
                                       committer,
 
88
                                       revno,
 
89
                                       None,
 
90
                                       line.rstrip("\r\n")
 
91
                                      ])
 
92
 
 
93
            if not self.plain:
 
94
                self._set_oldest_newest()
 
95
                # Recall that calling activate_default will emit "span-changed",
 
96
                # so self._span_changed_cb will take care of initial highlighting
 
97
                self.span_selector.activate_default()
 
98
        finally:
 
99
            branch.repository.unlock()
 
100
            branch.unlock()
95
101
 
96
102
        self.annoview.set_model(self.annomodel)
97
103
        self.annoview.grab_focus()
118
124
        
119
125
        revision_cache = RevisionCache(repository)
120
126
        for origin, text in weave.annotate_iter(rev_id):
121
 
            rev_id = weave.idx_to_name(origin)
 
127
            rev_id = origin
122
128
            try:
123
129
                revision = revision_cache.get_revision(rev_id)
124
130
                if rev_id in rev_hist: