/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: 2008-06-29 19:18:34 UTC
  • mto: This revision was merged to the branch mainline in revision 515.
  • Revision ID: jelmer@samba.org-20080629191834-ha2ecpv5szt96nge
Make sure signed testament matches repository data.

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