/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

List pull and merge in nautilus-bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
 
158
158
        return
159
159
 
 
160
    def pull_cb(self, menu, vfs_file):
 
161
        # We can only cope with local files
 
162
        if vfs_file.get_uri_scheme() != 'file':
 
163
            return
 
164
 
 
165
        file = vfs_file.get_uri()
 
166
 
 
167
        # We only want to continue here if we get a NotBranchError
 
168
        try:
 
169
            tree, path = WorkingTree.open_containing(file)
 
170
        except NotBranchError:
 
171
            return
 
172
 
 
173
        from bzrlib.plugins.gtk.olive.pull import PullDialog
 
174
        dialog = PullDialog(tree, path)
 
175
        dialog.display()
 
176
        gtk.main()
 
177
 
 
178
    def merge_cb(self, menu, vfs_file):
 
179
        # We can only cope with local files
 
180
        if vfs_file.get_uri_scheme() != 'file':
 
181
            return
 
182
 
 
183
        file = vfs_file.get_uri()
 
184
 
 
185
        # We only want to continue here if we get a NotBranchError
 
186
        try:
 
187
            tree, path = WorkingTree.open_containing(file)
 
188
        except NotBranchError:
 
189
            return
 
190
 
 
191
        from bzrlib.plugins.gtk.olive.merge import MergeDialog
 
192
        dialog = MergeDialog(tree, path)
 
193
        dialog.display()
 
194
        gtk.main()
 
195
 
160
196
    def get_background_items(self, window, vfs_file):
161
197
        items = []
162
198
        file = vfs_file.get_uri()
183
219
        item.connect('activate', self.log_cb, vfs_file)
184
220
        items.append(item)
185
221
 
 
222
        item = nautilus.MenuItem('BzrNautilus::pull',
 
223
                             'Pull',
 
224
                             'Pull from another branch')
 
225
        item.connect('activate', self.pull_cb, vfs_file)
 
226
        items.append(item)
 
227
 
 
228
        item = nautilus.MenuItem('BzrNautilus::merge',
 
229
                             'Merge',
 
230
                             'Merge from another branch')
 
231
        item.connect('activate', self.merge_cb, vfs_file)
 
232
        items.append(item)
 
233
 
186
234
        item = nautilus.MenuItem('BzrNautilus::commit',
187
235
                             'Commit',
188
236
                             'Commit Changes')