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

  • Committer: Daniel Schierbeck
  • Date: 2007-11-12 17:11:33 UTC
  • mfrom: (330.6.1 trunk)
  • Revision ID: daniel.schierbeck@gmail.com-20071112171133-ju9afbjziskeep2w
Merged with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
import bzrlib
25
25
import gtk
26
 
import gobject
27
26
from bzrlib import (errors, ui)
28
27
from bzrlib.revision import NULL_REVISION
29
28
 
30
29
class RevisionPopupMenu(gtk.Menu):
31
 
 
32
 
    __gsignals__ = {
33
 
            'tag-added': (
34
 
                gobject.SIGNAL_RUN_FIRST,
35
 
                gobject.TYPE_NONE,
36
 
                (gobject.TYPE_STRING, gobject.TYPE_STRING)
37
 
            )
38
 
    }
39
 
 
40
30
    def __init__(self, repository, revids, branch=None, wt=None):
41
31
        super(RevisionPopupMenu, self).__init__()
42
32
        self.branch = branch
96
86
    def show_push(self, item):
97
87
        from bzrlib.plugins.gtk.push import PushDialog
98
88
        dialog = PushDialog(self.repository, self.revids[0], self.branch)
99
 
        response = dialog.run()
100
 
 
101
 
        if response != gtk.RESPONSE_NONE:
102
 
            dialog.destroy()
 
89
        dialog.run()
103
90
 
104
91
    def show_tag(self, item):
105
92
        from bzrlib.plugins.gtk.tags import AddTagDialog
106
93
        dialog = AddTagDialog(self.repository, self.revids[0], self.branch)
107
94
        response = dialog.run()
108
 
 
109
95
        if response != gtk.RESPONSE_NONE:
110
96
            dialog.hide()
111
97
        
112
98
            if response == gtk.RESPONSE_OK:
113
 
                self.emit('tag-added', dialog.tagname, dialog._revid)
 
99
                try:
 
100
                    self.branch.lock_write()
 
101
                    self.branch.tags.set_tag(dialog.tagname, dialog._revid)
 
102
                finally:
 
103
                    self.branch.unlock()
114
104
            
115
105
            dialog.destroy()
116
106