/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 nautilus-bzr.py

  • Committer: Jelmer Vernooij
  • Date: 2007-07-15 18:12:57 UTC
  • Revision ID: jelmer@samba.org-20070715181257-g264qus2zyi3v39z
Add RevisionSelectionBox widget, use in TagDialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Trivial Bazaar plugin for Nautilus
 
2
#
 
3
# Copyright (C) 2006 Jeff Bailey
 
4
# Copyright (C) 2006 Wouter van Heyst
 
5
# Copyright (C) 2006 Jelmer Vernooij
 
6
#
 
7
# Published under the GNU GPL
 
8
 
1
9
import nautilus
2
10
import bzrlib
3
11
from bzrlib.bzrdir import BzrDir
70
78
        except NotBranchError:
71
79
            return
72
80
 
73
 
        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
 
81
        from bzrlib.plugins.gtk.viz.diff import DiffWindow
74
82
        window = DiffWindow()
75
83
        window.set_diff(tree.branch.nick, tree, tree.branch.basis_tree())
76
84
        window.show()
118
126
        if vfs_file.get_uri_scheme() != 'file':
119
127
            return
120
128
 
121
 
        from bzrlib.plugins.gtk.olive.branch import BranchDialog
 
129
        from bzrlib.plugins.gtk.branch import BranchDialog
122
130
        
123
131
        dialog = BranchDialog(vfs_file.get_name())
124
132
        dialog.display()
134
142
        except NotBranchError:
135
143
            return
136
144
 
137
 
        from bzrlib.plugins.gtk.olive.commit import CommitDialog
 
145
        from bzrlib.plugins.gtk.commit import CommitDialog
138
146
        dialog = CommitDialog(tree, path)
139
147
        dialog.display()
140
148
        gtk.main()
157
165
 
158
166
        return
159
167
 
 
168
    def pull_cb(self, menu, vfs_file):
 
169
        # We can only cope with local files
 
170
        if vfs_file.get_uri_scheme() != 'file':
 
171
            return
 
172
 
 
173
        file = vfs_file.get_uri()
 
174
 
 
175
        # We only want to continue here if we get a NotBranchError
 
176
        try:
 
177
            tree, path = WorkingTree.open_containing(file)
 
178
        except NotBranchError:
 
179
            return
 
180
 
 
181
        from bzrlib.plugins.gtk.pull import PullDialog
 
182
        dialog = PullDialog(tree, path)
 
183
        dialog.display()
 
184
        gtk.main()
 
185
 
 
186
    def merge_cb(self, menu, vfs_file):
 
187
        # We can only cope with local files
 
188
        if vfs_file.get_uri_scheme() != 'file':
 
189
            return
 
190
 
 
191
        file = vfs_file.get_uri()
 
192
 
 
193
        # We only want to continue here if we get a NotBranchError
 
194
        try:
 
195
            tree, path = WorkingTree.open_containing(file)
 
196
        except NotBranchError:
 
197
            return
 
198
 
 
199
        from bzrlib.plugins.gtk.merge import MergeDialog
 
200
        dialog = MergeDialog(tree, path)
 
201
        dialog.display()
 
202
        gtk.main()
 
203
 
160
204
    def get_background_items(self, window, vfs_file):
161
205
        items = []
162
206
        file = vfs_file.get_uri()
183
227
        item.connect('activate', self.log_cb, vfs_file)
184
228
        items.append(item)
185
229
 
 
230
        item = nautilus.MenuItem('BzrNautilus::pull',
 
231
                             'Pull',
 
232
                             'Pull from another branch')
 
233
        item.connect('activate', self.pull_cb, vfs_file)
 
234
        items.append(item)
 
235
 
 
236
        item = nautilus.MenuItem('BzrNautilus::merge',
 
237
                             'Merge',
 
238
                             'Merge from another branch')
 
239
        item.connect('activate', self.merge_cb, vfs_file)
 
240
        items.append(item)
 
241
 
186
242
        item = nautilus.MenuItem('BzrNautilus::commit',
187
243
                             'Commit',
188
244
                             'Commit Changes')