10
10
if len(sys.argv) < 2:
11
print "Usage: handle-patch <path>"
11
print "Usage: handle-patch <path>"
18
from bzrlib.plugins.gtk.diff import (DiffController,
19
MergeDirectiveController)
21
lines = sys.stdin.readlines()
23
lines = open(path, 'rb').readlines()
24
lines = [l.replace('\r\n', '\n') for l in lines]
26
directive = merge_directive.MergeDirective.from_lines(lines)
27
except errors.NotAMergeDirective:
28
controller = DiffController(path, lines, allow_dirty=True)
30
controller = MergeDirectiveController(path, directive)
31
window = controller.window
34
window.connect("destroy", Gtk.main_quit)
18
from bzrlib.plugins.gtk.diff import (DiffController,
19
MergeDirectiveController)
21
lines = sys.stdin.readlines()
23
lines = open(path, 'rb').readlines()
24
lines = [l.replace('\r\n', '\n') for l in lines]
26
directive = merge_directive.MergeDirective.from_lines(lines)
27
except errors.NotAMergeDirective:
28
controller = DiffController(path, lines, allow_dirty=True)
30
controller = MergeDirectiveController(path, directive)
31
window = controller.window
34
window.connect("destroy", Gtk.main_quit)
35
35
except Exception, e:
36
from bzrlib.plugins.gtk.dialog import error_dialog
37
error_dialog('Error', str(e))
36
from bzrlib.plugins.gtk.dialog import error_dialog
37
error_dialog('Error', str(e))
40
40
if len(sys.argv) == 3 and sys.argv[2] == 'test':