Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

clone: further improvements to dest path logic

If the destination path is the current directory, there are two options:
If the current directory is empty, clone to this directory ('.' as dest path)
If the current directory is not empty, allow mercurial to build the dest path

Changeset 20e5bcf14e01

Parent ba6ce5305165

by Steve Borho

Changes to one file · Browse files at 20e5bcf14e01 Showing diff from parent ba6ce5305165 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​clone.py Stacked
 
239
240
241
 
 
242
243
244
 
265
266
267
 
 
 
 
 
 
 
 
268
269
270
 
239
240
241
242
243
244
245
246
 
267
268
269
270
271
272
273
274
275
276
277
278
279
280
@@ -239,6 +239,8 @@
  self._srclist.append([p])     def _add_dest_to_recent(self, dest): + if not dest: + return   if os.path.exists(dest):   dest = os.path.abspath(dest)   @@ -265,6 +267,14 @@
  error_dialog(self, _('Source path is empty'), _('Please enter'))   self._src_input.grab_focus()   return False + + if dest == os.getcwd(): + if os.listdir(dest): + # cur dir has files, specify no dest, let hg take + # basename + dest = None + else: + dest = '.'     # start cloning   try: