/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: Jasper Groenewegen
  • Date: 2008-07-25 18:45:04 UTC
  • mfrom: (571.1.1 add-gmerge)
  • Revision ID: colbrac@xs4all.nl-20080725184504-qdztpy93ftgg9jy1
Merge addition of gmerge command line option

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
gconflicts        GTK+ conflicts. 
23
23
gdiff             Show differences in working tree in a GTK+ Window. 
24
24
ginit             Initialise a new branch.
 
25
gmerge            GTK+ merge dialog
25
26
gmissing          GTK+ missing revisions dialog. 
26
27
gpreferences      GTK+ preferences dialog. 
27
28
gpush             GTK+ push.
451
452
        dialog.run()
452
453
 
453
454
 
 
455
class cmd_gmerge(Command):
 
456
    """ GTK+ merge dialog
 
457
    
 
458
    """
 
459
    takes_args = ["merge_from_path?"]
 
460
    def run(self, merge_from_path=None):
 
461
        from bzrlib import workingtree
 
462
        from bzrlib.plugins.gtk.dialog import error_dialog
 
463
        from bzrlib.plugins.gtk.merge import MergeDialog
 
464
        
 
465
        (wt, path) = workingtree.WorkingTree.open_containing('.')
 
466
        old_tree = wt.branch.repository.revision_tree(wt.branch.last_revision())
 
467
        delta = wt.changes_from(old_tree)
 
468
        if len(delta.added) or len(delta.removed) or len(delta.renamed) or len(delta.modified):
 
469
            error_dialog(_i18n('There are local changes in the branch'),
 
470
                         _i18n('Please commit or revert the changes before merging.'))
 
471
        else:
 
472
            parent_branch_path = wt.branch.get_parent()
 
473
            merge = MergeDialog(wt, path, parent_branch_path)
 
474
            response = merge.run()
 
475
            merge.destroy()
 
476
 
 
477
 
454
478
class cmd_gmissing(Command):
455
479
    """ GTK+ missing revisions dialog.
456
480
 
514
538
    cmd_gconflicts, 
515
539
    cmd_gdiff,
516
540
    cmd_ginit,
 
541
    cmd_gmerge,
517
542
    cmd_gmissing, 
518
543
    cmd_gpreferences, 
519
544
    cmd_gpush,