/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 branchview/treeview.py

  • Committer: Jelmer Vernooij
  • Date: 2011-02-18 11:53:18 UTC
  • mfrom: (452.5.2 viz-locks)
  • Revision ID: jelmer@samba.org-20110218115318-xgsxhn13fd3m6nj9
Add lock dialog. (Daniel Schierbeck)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from graphcell import CellRendererGraph
22
22
from treemodel import TreeModel
23
23
from bzrlib.revision import NULL_REVISION
 
24
from bzrlib.plugins.gtk import lock
24
25
 
25
26
 
26
27
class TreeView(gtk.VBox):
225
226
    def add_tag(self, tag, revid=None):
226
227
        if revid is None: revid = self.revision.revision_id
227
228
 
228
 
        try:
229
 
            self.branch.unlock()
230
 
 
 
229
        if lock.release(self.branch):
231
230
            try:
232
 
                self.branch.lock_write()
 
231
                lock.acquire(self.branch, lock.WRITE)
233
232
                self.model.add_tag(tag, revid)
234
233
            finally:
235
 
                self.branch.unlock()
236
 
 
237
 
        finally:
238
 
            self.branch.lock_read()
239
 
 
240
 
        self.emit('tag-added', tag, revid)
 
234
                lock.release(self.branch)
 
235
 
 
236
            lock.acquire(self.branch, lock.READ)
 
237
 
 
238
            self.emit('tag-added', tag, revid)
241
239
        
242
240
    def refresh(self):
243
241
        gobject.idle_add(self.populate, self.get_revision())