/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-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:
77
77
    branch,
78
78
    builtins,
79
79
    errors,
 
80
    merge_directive,
80
81
    workingtree,
81
82
    )
82
83
""")
679
680
    def run(self, path):
680
681
        from bzrlib.plugins.gtk.diff import DiffWindow
681
682
        window = DiffWindow()
682
 
        window.set_diff_text(path, open(path, 'rb').read())
 
683
        lines = open(path, 'rb').readlines()
 
684
        try:
 
685
            directive = merge_directive.MergeDirective.from_lines(lines)
 
686
        except errors.NotAMergeDirective:
 
687
            window.set_diff_text(path, lines)
 
688
        else:
 
689
            window.set_diff_text(path, directive.patch.splitlines(True))
683
690
        window.show()
684
691
        gtk = self.open_display()
685
692
        window.connect("destroy", gtk.main_quit)