/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: Daniel Schierbeck
  • Date: 2008-01-13 14:12:49 UTC
  • mto: (423.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 429.
  • Revision ID: daniel.schierbeck@gmail.com-20080113141249-gd0i2lknr3yik55r
Moved branch view to its own package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
gcommit           GTK+ commit dialog.
23
23
gconflicts        GTK+ conflicts. 
24
24
gdiff             Show differences in working tree in a GTK+ Window. 
25
 
ghandle-patch     Display and optionally merge a merge directive or patch.
26
25
ginit             Initialise a new branch.
27
26
gmissing          GTK+ missing revisions dialog. 
28
27
gpreferences      GTK+ preferences dialog. 
78
77
    branch,
79
78
    builtins,
80
79
    errors,
81
 
    merge_directive,
82
80
    workingtree,
83
81
    )
84
82
""")
220
218
    
221
219
    :return: The viz window object.
222
220
    """
223
 
    from viz import BranchWindow
 
221
    from viz.branchwin import BranchWindow
224
222
    return BranchWindow(branch, revision, limit)
225
223
 
226
224
 
306
304
 
307
305
        window = GAnnotateWindow(all, plain)
308
306
        window.connect("destroy", lambda w: gtk.main_quit())
 
307
        window.set_title(path + " - gannotate")
309
308
        config = GAnnotateConfig(window)
310
309
        window.show()
311
310
        br.lock_read()
673
672
register_command(cmd_test_gtk)
674
673
 
675
674
 
676
 
class cmd_ghandle_patch(GTKCommand):
677
 
    """Display a patch or merge directive, possibly merging.
678
 
 
679
 
    This is a helper, meant to be launched from other programs like browsers
680
 
    or email clients.  Since these programs often do not allow parameters to
681
 
    be provided, a "handle-patch" script is included.
682
 
    """
683
 
 
684
 
    takes_args = ['path']
685
 
 
686
 
    def run(self, path):
687
 
        try:
688
 
            from bzrlib.plugins.gtk.diff import (DiffWindow,
689
 
                                                 MergeDirectiveWindow)
690
 
            lines = open(path, 'rb').readlines()
691
 
            lines = [l.replace('\r\n', '\n') for l in lines]
692
 
            try:
693
 
                directive = merge_directive.MergeDirective.from_lines(lines)
694
 
            except errors.NotAMergeDirective:
695
 
                window = DiffWindow()
696
 
                window.set_diff_text(path, lines)
697
 
            else:
698
 
                window = MergeDirectiveWindow(directive, path)
699
 
                window.set_diff_text(path, directive.patch.splitlines(True))
700
 
            window.show()
701
 
            gtk = self.open_display()
702
 
            window.connect("destroy", gtk.main_quit)
703
 
        except Exception, e:
704
 
            from dialog import error_dialog
705
 
            error_dialog('Error', str(e))
706
 
            raise
707
 
        gtk.main()
708
 
 
709
 
 
710
 
register_command(cmd_ghandle_patch)
711
 
 
712
 
 
713
675
import gettext
714
676
gettext.install('olive-gtk')
715
677