comparison mercurial/commands.py @ 513:2ab152e45de4

hg clone: don't try to delete "." -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg clone: don't try to delete "." manifest hash: 7e7bd5375f7729812b7188b7a53287b3c6049823 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCwZvlywK+sNU5EO8RAjn6AKCaBNWdLSNXIDqQZ3vMcN5ie5ZZaQCfaG37 hAN32PbYoQh8UC88AeOKOk4= =kBOD -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 28 Jun 2005 10:50:13 -0800
parents 78896f572a22
children 03f27b1381f9
comparison
equal deleted inserted replaced
512:78896f572a22 513:2ab152e45de4
267 267
268 def clone(ui, source, dest = None, **opts): 268 def clone(ui, source, dest = None, **opts):
269 """make a copy of an existing repository""" 269 """make a copy of an existing repository"""
270 source = ui.expandpath(source) 270 source = ui.expandpath(source)
271 271
272 created = success = False 272 success = False
273 273
274 if dest is None: 274 if dest is None:
275 dest = os.getcwd() 275 dest = os.getcwd()
276 elif not os.path.exists(dest): 276 elif not os.path.exists(dest):
277 os.mkdir(dest) 277 os.mkdir(dest)
312 update(ui, repo) 312 update(ui, repo)
313 313
314 success = True 314 success = True
315 315
316 finally: 316 finally:
317 if not success: 317 if created and not success:
318 import shutil 318 import shutil
319 shutil.rmtree(dest, True) 319 shutil.rmtree(dest, True)
320 320
321 def commit(ui, repo, *files, **opts): 321 def commit(ui, repo, *files, **opts):
322 """commit the specified files or all outstanding changes""" 322 """commit the specified files or all outstanding changes"""