34
33
from dialog import error_dialog, info_dialog
35
from history import UrlHistory
37
37
class BranchDialog(gtk.Dialog):
38
38
""" New implementation of the Branch dialog. """
101
101
self.vbox.show_all()
103
103
# Build branch history
104
self._history = UrlHistory(GlobalConfig(), 'branch_history')
104
105
self._build_history()
106
107
def _build_history(self):
107
108
""" Build up the branch history. """
108
config = GlobalConfig()
109
history = config.get_user_option('gbranch_history')
110
if history is not None:
111
self._combo_model = gtk.ListStore(str)
112
for item in history.split(delimiter):
113
self._combo_model.append([ item ])
114
self._combo.set_model(self._combo_model)
115
self._combo.set_text_column(0)
117
def _add_to_history(self, location):
118
""" Add specified location to the history (if not yet added). """
119
config = GlobalConfig()
120
history = config.get_user_option('gbranch_history')
122
config.set_user_option('gbranch_history', location)
124
h = history.split(delimiter)
125
if location not in h:
127
config.set_user_option('gbranch_history', delimiter.join(h))
109
self._combo_model = gtk.ListStore(str)
110
for item in self._history.get_entries():
111
self._combo_model.append([ item ])
112
self._combo.set_model(self._combo_model)
113
self._combo.set_text_column(0)
129
115
def _get_last_revno(self):
130
116
""" Get the revno of the last revision (if any). """
208
self._add_to_history(location)
194
self._history.add_entry(location)
209
195
info_dialog(_('Branching successful'),
210
196
_('%d revision(s) branched.') % revs)