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

  • Committer: Aaron Bentley
  • Date: 2008-01-14 05:12:30 UTC
  • Revision ID: aaron@aaronbentley.com-20080114051230-8f91ej31sd2o6oa9
Start support for Merge Directives

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from bzrlib import osutils
34
34
from bzrlib.diff import show_diff_trees, internal_diff
35
35
from bzrlib.errors import NoSuchFile
 
36
from bzrlib.patches import parse_patches
36
37
from bzrlib.trace import warning
37
38
from bzrlib.plugins.gtk.window import Window
38
39
 
234
235
#            self.parent_tree.unlock()
235
236
 
236
237
    def show_diff(self, specific_files):
237
 
        self.buffer.set_text(self._diffs[None])
 
238
        sections = []
 
239
        if specific_files is None:
 
240
            self.buffer.set_text(self._diffs[None])
 
241
        else:
 
242
            for specific_file in specific_files:
 
243
                sections.append(self._diffs[specific_file])
 
244
            self.buffer.set_text(''.join(sections))
238
245
 
239
246
 
240
247
class DiffView(DiffFileView):
322
329
        column.add_attribute(cell, "text", 0)
323
330
        self.treeview.append_column(column)
324
331
 
325
 
    def set_diff_text(self, description, text):
 
332
    def set_diff_text(self, description, lines):
326
333
        # The diffs of the  selected file: a scrollable source or
327
334
        # text view
328
335
        self.diff_view = DiffFileView()
329
336
        self.diff_view.show()
330
337
        self.pane.pack2(self.diff_view)
331
338
        self.model.append(None, [ "Complete Diff", "" ])
332
 
        self.diff_view._diffs[None] = text
 
339
        self.diff_view._diffs[None] = ''.join(lines)
 
340
        for patch in parse_patches(lines):
 
341
            oldname = patch.oldname.split('\t')[0]
 
342
            newname = patch.newname.split('\t')[0]
 
343
            self.model.append(None, [oldname, newname])
 
344
            self.diff_view._diffs[newname] = str(patch)
333
345
        
334
346
 
335
347
    def set_diff(self, description, rev_tree, parent_tree):