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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2007-02-01 10:52:33 UTC
  • mto: (157.1.2 trunk) (170.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 141.
  • Revision ID: szilveszter.farkas@gmail.com-20070201105233-q0azmkxxawlyhemi
Improved Branch dialog. Refactored Checkout dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    pass
24
24
 
25
25
import gtk
26
 
import gtk.glade
27
26
 
28
27
from errors import show_bzr_error
29
28
 
54
53
        self._combo = gtk.ComboBoxEntry()
55
54
        self._label_location = gtk.Label(_("Branch location:"))
56
55
        self._label_destination = gtk.Label(_("Destination:"))
 
56
        self._label_nick = gtk.Label(_("Branck nick:"))
57
57
        self._label_revision = gtk.Label(_("Revision:"))
58
58
        self._hbox_revision = gtk.HBox()
59
59
        self._entry_revision = gtk.Entry()
 
60
        self._entry_nick = gtk.Entry()
60
61
        
61
62
        # Set callbacks
62
63
        self._button_branch.connect('clicked', self._on_branch_clicked)
67
68
        self._table = gtk.Table(rows=3, columns=2)
68
69
        self._table.attach(self._label_location, 0, 1, 0, 1)
69
70
        self._table.attach(self._label_destination, 0, 1, 1, 2)
70
 
        self._table.attach(self._label_revision, 0, 1, 2, 3)
 
71
        self._table.attach(self._label_nick, 0, 1, 2, 3)
 
72
        self._table.attach(self._label_revision, 0, 1, 3, 4)
71
73
        self._table.attach(self._combo, 1, 2, 0, 1)
72
74
        self._table.attach(self._filechooser, 1, 2, 1, 2)
73
 
        self._table.attach(self._hbox_revision, 1, 2, 2, 3)
 
75
        self._table.attach(self._entry_nick, 1, 2, 2, 3)
 
76
        self._table.attach(self._hbox_revision, 1, 2, 3, 4)
74
77
        
75
78
        # Set properties
76
79
        self._image_browse.set_from_stock(gtk.STOCK_OPEN, gtk.ICON_SIZE_BUTTON)
79
82
        self._filechooser.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
80
83
        self._label_location.set_alignment(0, 0.5)
81
84
        self._label_destination.set_alignment(0, 0.5)
 
85
        self._label_nick.set_alignment(0, 0.5)
82
86
        self._label_revision.set_alignment(0, 0.5)
83
87
        self._table.set_row_spacings(3)
84
88
        self._table.set_col_spacings(3)
136
140
        from revbrowser import RevisionBrowser
137
141
        
138
142
        location = self._combo.get_child().get_text()
 
143
        
139
144
        try:
140
145
            br = Branch.open(location)
141
146
        except:
167
172
        except:
168
173
            revno = None
169
174
        
 
175
        nick = self._entry_nick.get_text()
 
176
        if nick is '':
 
177
            nick = os.path.basename(location.rstrip("/\\"))
 
178
        
170
179
        br_from = Branch.open(location)
171
180
        
172
181
        br_from.lock_read()
177
186
 
178
187
            basis_dir = None
179
188
            
180
 
            to_location = destination + '/' + os.path.basename(location.rstrip("/\\"))
 
189
            to_location = destination + os.sep + nick
181
190
            to_transport = get_transport(to_location)
182
191
            
183
192
            to_transport.mkdir('.')
210
219
        else:
211
220
            self._entry_revision.set_text(str(rev))
212
221
            self._button_revision.set_sensitive(True)
 
222
            if self._entry_nick.get_text() == '':
 
223
                self._entry_nick.set_text(os.path.basename(self._combo.get_child().get_text().rstrip("/\\")))