/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: Daniel Schierbeck
  • Date: 2008-04-07 20:34:51 UTC
  • mfrom: (450.6.13 bugs)
  • mto: (463.2.1 bug.78765)
  • mto: This revision was merged to the branch mainline in revision 462.
  • Revision ID: daniel.schierbeck@gmail.com-20080407203451-2i6el7jf9t0k9y64
Merged bug page improvements.

Show diffs side-by-side

added added

removed removed

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