/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 bzr-handle-patch

  • Committer: Curtis Hovey
  • Date: 2012-03-11 18:24:06 UTC
  • mto: This revision was merged to the branch mainline in revision 785.
  • Revision ID: sinzui.is@verizon.net-20120311182406-f4jqpff65b30g3al
Create the mnemonic for the button label.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import sys
9
9
 
10
10
if len(sys.argv) < 2:
11
 
    print "Usage: handle-patch <path>"
12
 
    sys.exit(1)
 
11
        print "Usage: handle-patch <path>"
 
12
        sys.exit(1)
13
13
 
14
14
 
15
15
path = sys.argv[1]
16
16
 
17
17
try:
18
 
    from bzrlib.plugins.gtk.diff import (DiffController,
19
 
                                         MergeDirectiveController)
20
 
    if path == '-':
21
 
        lines = sys.stdin.readlines()
22
 
    else:
23
 
        lines = open(path, 'rb').readlines()
24
 
    lines = [l.replace('\r\n', '\n') for l in lines]
25
 
    try:
26
 
        directive = merge_directive.MergeDirective.from_lines(lines)
27
 
    except errors.NotAMergeDirective:
28
 
        controller = DiffController(path, lines, allow_dirty=True)
29
 
    else:
30
 
        controller = MergeDirectiveController(path, directive)
31
 
    window = controller.window
32
 
    window.show()
33
 
    Gtk = open_display()
34
 
    window.connect("destroy", Gtk.main_quit)
 
18
        from bzrlib.plugins.gtk.diff import (DiffController,
 
19
                                                                                 MergeDirectiveController)
 
20
        if path == '-':
 
21
                lines = sys.stdin.readlines()
 
22
        else:
 
23
                lines = open(path, 'rb').readlines()
 
24
        lines = [l.replace('\r\n', '\n') for l in lines]
 
25
        try:
 
26
                directive = merge_directive.MergeDirective.from_lines(lines)
 
27
        except errors.NotAMergeDirective:
 
28
                controller = DiffController(path, lines, allow_dirty=True)
 
29
        else:
 
30
                controller = MergeDirectiveController(path, directive)
 
31
        window = controller.window
 
32
        window.show()
 
33
        Gtk = open_display()
 
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))
38
 
    raise
 
36
        from bzrlib.plugins.gtk.dialog import error_dialog
 
37
        error_dialog('Error', str(e))
 
38
        raise
39
39
 
40
40
if len(sys.argv) == 3 and sys.argv[2] == 'test':
41
41
    sys.exit(0)