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

  • Committer: Aaron Bentley
  • Date: 2007-01-17 06:42:55 UTC
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: aaron.bentley@utoronto.ca-20070117064255-x4gznz5e0lyjq3gk
Remove usused span selector

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