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

  • Committer: Aaron Bentley
  • Date: 2008-05-08 08:45:15 UTC
  • mto: This revision was merged to the branch mainline in revision 492.
  • Revision ID: aaron@aaronbentley.com-20080508084515-0h1ge28g39mqab5s
Unify MergeDirectiveWindow and DiffWindow

Show diffs side-by-side

added added

removed removed

Lines of Context:
705
705
 
706
706
    def run(self, path):
707
707
        try:
708
 
            from bzrlib.plugins.gtk.diff import (DiffWindow,
 
708
            from bzrlib.plugins.gtk.diff import (DiffController,
709
709
                                                 MergeDirectiveController)
710
710
            lines = open(path, 'rb').readlines()
711
711
            lines = [l.replace('\r\n', '\n') for l in lines]
712
712
            try:
713
713
                directive = merge_directive.MergeDirective.from_lines(lines)
714
714
            except errors.NotAMergeDirective:
715
 
                window = DiffWindow()
716
 
                window.set_diff_text(path, lines)
 
715
                controller = DiffController(path, lines)
717
716
            else:
718
 
                controller = MergeDirectiveController.for_gtk(directive, path)
719
 
                window = controller.window
 
717
                controller = MergeDirectiveController(path, directive)
 
718
            window = controller.window
720
719
            window.show()
721
720
            gtk = self.open_display()
722
721
            window.connect("destroy", gtk.main_quit)