/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: 2009-06-04 21:10:21 UTC
  • Revision ID: jelmer@samba.org-20090604211021-o3ycs1uy97mwoime
Catch NoKeyringDaemonError.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib.plugin import load_plugins
20
20
load_plugins()
21
21
 
22
 
from bzrlib.plugins.gtk import _i18n, cmd_visualise, cmd_gannotate
 
22
from bzrlib.plugins.gtk import _i18n, cmd_gannotate, start_viz_window
 
23
 
 
24
print "Bazaar nautilus module initialized"
 
25
 
23
26
 
24
27
class BzrExtension(nautilus.MenuProvider, nautilus.ColumnProvider, nautilus.InfoProvider):
25
28
    def __init__(self):
83
86
 
84
87
        from bzrlib.plugins.gtk.diff import DiffWindow
85
88
        window = DiffWindow()
86
 
        window.set_diff(tree.branch.nick, tree, tree.branch.basis_tree())
 
89
        window.set_diff(tree.branch._get_nick(local=True), tree, 
 
90
                        tree.branch.basis_tree())
87
91
        window.show()
88
92
 
89
93
        return
174
178
 
175
179
        # We only want to continue here if we get a NotBranchError
176
180
        try:
177
 
            tree, path = WorkingTree.open_containing(file)
 
181
            branch, path = Branch.open_containing(file)
178
182
        except NotBranchError:
179
183
            return
180
184
 
181
 
        vis = cmd_visualise()
182
 
        vis.run(file)
183
 
 
184
 
        return
 
185
        pp = start_viz_window(branch, [branch.last_revision()])
 
186
        pp.show()
 
187
        gtk.main()
185
188
 
186
189
    def pull_cb(self, menu, vfs_file):
187
190
        # We can only cope with local files
216
219
 
217
220
        from bzrlib.plugins.gtk.merge import MergeDialog
218
221
        dialog = MergeDialog(tree, path)
219
 
        dialog.display()
220
 
        gtk.main()
 
222
        dialog.run()
 
223
        dialog.destroy()
221
224
 
222
225
    def get_background_items(self, window, vfs_file):
223
226
        items = []
237
240
            items.append(item)
238
241
 
239
242
            item = nautilus.MenuItem('BzrNautilus::clone',
240
 
                                 'Checkout Bazaar branch',
 
243
                                 'Checkout Bazaar branch ...',
241
244
                                 'Checkout Existing Bazaar Branch')
242
245
            item.connect('activate', self.clone_cb, vfs_file)
243
246
            items.append(item)
254
257
            return item,
255
258
        else:
256
259
            item = nautilus.MenuItem('BzrNautilus::disable',
257
 
                                      'Disable Bazaar Plugin for the Branch',
 
260
                                      'Disable Bazaar Plugin this Branch',
258
261
                                      'Disable Bazaar plugin for nautilus')
259
262
            item.connect('activate', self.toggle_integration, 'False', vfs_file)
260
263
            items.append(item)
261
264
 
262
265
        item = nautilus.MenuItem('BzrNautilus::log',
263
 
                             'Log',
 
266
                             'History ...',
264
267
                             'Show Bazaar history')
265
268
        item.connect('activate', self.log_cb, vfs_file)
266
269
        items.append(item)
267
270
 
268
271
        item = nautilus.MenuItem('BzrNautilus::pull',
269
 
                             'Pull',
 
272
                             'Pull ...',
270
273
                             'Pull from another branch')
271
274
        item.connect('activate', self.pull_cb, vfs_file)
272
275
        items.append(item)
273
276
 
274
277
        item = nautilus.MenuItem('BzrNautilus::merge',
275
 
                             'Merge',
 
278
                             'Merge ...',
276
279
                             'Merge from another branch')
277
280
        item.connect('activate', self.merge_cb, vfs_file)
278
281
        items.append(item)
279
282
 
280
283
        item = nautilus.MenuItem('BzrNautilus::commit',
281
 
                             'Commit',
 
284
                             'Commit ...',
282
285
                             'Commit Changes')
283
286
        item.connect('activate', self.commit_cb, vfs_file)
284
287
        items.append(item)
341
344
                items.append(item)
342
345
            elif wtfiles[path] == 'V':
343
346
                item = nautilus.MenuItem('BzrNautilus::log',
344
 
                                 'Log',
 
347
                                 'History ...',
345
348
                                 'List changes')
346
349
                item.connect('activate', self.log_cb, vfs_file)
347
350
                items.append(item)
348
351
 
349
352
                item = nautilus.MenuItem('BzrNautilus::diff',
350
 
                                 'Diff',
 
353
                                 'View Changes ...',
351
354
                                 'Show differences')
352
355
                item.connect('activate', self.diff_cb, vfs_file)
353
356
                items.append(item)
359
362
                items.append(item)
360
363
 
361
364
                item = nautilus.MenuItem('BzrNautilus::annotate',
362
 
                             'Annotate',
 
365
                             'Annotate ...',
363
366
                             'Annotate File Data')
364
367
                item.connect('activate', self.annotate_cb, vfs_file)
365
368
                items.append(item)
366
369
 
367
370
                item = nautilus.MenuItem('BzrNautilus::commit',
368
 
                             'Commit',
 
371
                             'Commit ...',
369
372
                             'Commit Changes')
370
373
                item.connect('activate', self.commit_cb, vfs_file)
371
374
                items.append(item)