Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

clone: add clone from bundle

Fixes #694

Changeset b3064d77bbfd

Parent 1392bbfc04ca

by Emmanuel Rosa

Changes to one file · Browse files at b3064d77bbfd Showing diff from parent 1392bbfc04ca Diff from another changeset...

 
51
52
53
54
 
55
56
57
 
74
75
76
77
 
 
 
 
 
 
 
78
79
80
 
85
86
87
88
 
89
90
91
 
206
207
208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
210
211
 
51
52
53
 
54
55
56
57
 
74
75
76
 
77
78
79
80
81
82
83
84
85
86
 
91
92
93
 
94
95
96
97
 
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
@@ -51,7 +51,7 @@
  elif len(repos):   srcpath = repos[0]   - def createcombo(path, label, title): + def createcombo(path, label, title, bundle=False):   # comboentry   model = gtk.ListStore(str)   combo = gtk.ComboBoxEntry(model, 0) @@ -74,7 +74,13 @@
  browse = gtk.Button(_('Browse...'))   browse.connect('clicked', self.browse_clicked, title, entry)   - table.add_row(label, combo, 0, browse) + if bundle: + # bundle button + bundlebtn = gtk.Button(_('Bundle...')) + bundlebtn.connect('clicked', self.bundle_clicked, title, entry) + table.add_row(label, combo, 0, browse, bundlebtn) + else: + table.add_row(label, combo, 0, browse)     return model, combo   @@ -85,7 +91,7 @@
  ## comboentry for source paths   self.srclist, srccombo = createcombo(srcpath,   _('Source path:'), - _('Select Source Folder')) + _('Select Source Folder'), True)   self.srcentry = srccombo.get_child()     ## add pre-defined src paths to pull-down list @@ -206,6 +212,21 @@
  if res:   entry.set_text(res)   + def bundle_clicked(self, button, title, entry): + path = entry.get_text() + if os.path.isdir(path): + initial = path + else: + initial = os.path.dirname(path) + + res = gtklib.NativeSaveFileDialogWrapper( + initial=initial, + title=title, + filter= ((_('Mercurial bundles'), '*.hg'),), + open=True).run() + if res: + entry.set_text(res) +   def checkbutton_toggled(self, checkbutton, entry):   state = checkbutton.get_active()   entry.set_sensitive(state)