Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc1, 0.4rc2, and 0.4rc3

hggtk/clone: save recently cloned source

Changeset b4bf54ece7f9

Parent 9355a4da1a9c

by TK Soh

Changes to one file · Browse files at b4bf54ece7f9 Showing diff from parent 9355a4da1a9c Diff from another changeset...

Change 1 of 5 Show Entire File hggtk/​clone.py Stacked
 
17
18
19
20
 
21
22
23
 
25
26
27
28
 
29
30
31
 
35
36
37
 
38
39
40
 
93
94
95
96
 
 
 
97
98
99
 
194
195
196
 
 
 
197
198
199
200
 
201
202
203
204
205
206
 
 
 
 
 
 
207
208
209
 
17
18
19
 
20
21
22
23
 
25
26
27
 
28
29
30
31
 
35
36
37
38
39
40
41
 
94
95
96
 
97
98
99
100
101
102
 
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
@@ -17,7 +17,7 @@
 from mercurial import hg, ui, cmdutil, util  from mercurial.i18n import _  from mercurial.node import * -from shlib import set_tortoise_icon +import shlib    class CloneDialog(gtk.Window):   """ Dialog to add tag to Mercurial repo """ @@ -25,7 +25,7 @@
  """ Initialize the Dialog """   gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)   - set_tortoise_icon(self, 'menuclone.ico') + shlib.set_tortoise_icon(self, 'menuclone.ico')   if cwd: os.chdir(cwd)     # set dialog title @@ -35,6 +35,7 @@
    self._src_path = ''   self._dest_path = '' + self._history = shlib.read_history('clone')     try:   self._src_path = repos[0] @@ -93,7 +94,9 @@
  vbox.pack_start(srcbox, False, False, 2)     # add pre-defined src paths to pull-down list - paths = [x[1] for x in ui.ui().configitems('paths')] + sympaths = [x[1] for x in ui.ui().configitems('paths')] + recentsrc = self._history.get('src_paths', []) + paths = list(set(sympaths + recentsrc))   paths.sort()   for p in paths: self._srclist.append([p])   @@ -194,16 +197,26 @@
  self._rev_input.set_text(rev)     def _add_src_to_recent(self, src): + if os.path.exists(src): + src = os.path.abspath(src) +   srclist = [x[0] for x in self._srclist]   if src in srclist:   return   + # update drop-down list   srclist.append(src)   srclist.sort()   self._srclist.clear()   for p in srclist:   self._srclist.append([p])   + # save path to recent list in history + if not 'src_paths' in self._history: + self._history['src_paths'] = [] + self._history['src_paths'].append(src) + shlib.save_history(self._history, 'clone') +   def _btn_clone_clicked(self, toolbutton, data=None):   # gather input data   src = self._src_input.get_text()