/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 merge.py

  • Committer: Jelmer Vernooij
  • Date: 2007-12-21 20:20:37 UTC
  • mto: This revision was merged to the branch mainline in revision 422.
  • Revision ID: jelmer@samba.org-20071221202037-6zvbwefvrte3e2zy
Fix URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from bzrlib.branch import Branch
29
29
import bzrlib.errors as errors
30
30
 
31
 
from __init__ import gladefile
32
31
from dialog import error_dialog, info_dialog, warning_dialog
 
32
from errors import show_bzr_error
 
33
from olive.guifiles import GLADEFILENAME
 
34
 
33
35
 
34
36
class MergeDialog:
35
37
    """ Display the Merge dialog and perform the needed actions. """
36
 
    def __init__(self, wt, wtpath):
 
38
    def __init__(self, wt, wtpath,default_branch_path=None):
37
39
        """ Initialize the Merge dialog. """
38
 
        self.glade = gtk.glade.XML(gladefile, 'window_merge', 'olive-gtk')
 
40
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_merge', 'olive-gtk')
39
41
        
40
42
        self.window = self.glade.get_widget('window_merge')
41
43
        
52
54
        
53
55
        # Get some widgets
54
56
        self.entry = self.glade.get_widget('entry_merge')
 
57
        if default_branch_path:
 
58
            self.entry.set_text(default_branch_path)
55
59
 
56
60
    def display(self):
57
61
        """ Display the Add file(s) dialog. """
58
62
        self.window.show_all()
59
63
 
 
64
    @show_bzr_error
60
65
    def merge(self, widget):
61
66
        branch = self.entry.get_text()
62
67
        if branch == "":
64
69
                         _('Please specify a branch to merge from.'))
65
70
            return
66
71
 
67
 
        try:
68
 
            other_branch = Branch.open_containing(branch)[0]
69
 
        except errors.NotBranchError:
70
 
            error_dialog(_('Specified location not a branch'),
71
 
                         _('Please specify a branch you want to merge from.'))
72
 
            return
73
 
        
 
72
        other_branch = Branch.open_containing(branch)[0]
 
73
 
74
74
        try:
75
75
            conflicts = self.wt.merge_from_branch(other_branch)
76
76
        except errors.BzrCommandError, errmsg: