comparison mercurial/commands.py @ 532:2e9698a5c92c

clone: abort on pre-existing destination directory -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 clone: abort on pre-existing destination directory manifest hash: c1c205ea212ed73521cebe0524da364f40ebf387 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCxCIjywK+sNU5EO8RArteAKCM7oPK+htBvhz7n0Eo//A1BuGRQwCfY1xL 7denU7OqsKUf9UKKkhbWLB8= =rhfi -----END PGP SIGNATURE-----
author mpm@selenic.com
date Thu, 30 Jun 2005 08:47:31 -0800
parents 648386fabf9c
children ab0d1bfeee7c
comparison
equal deleted inserted replaced
531:0e9234a1a3f6 532:2e9698a5c92c
271 271
272 success = False 272 success = False
273 273
274 if dest is None: 274 if dest is None:
275 dest = os.path.basename(os.path.normpath(source)) 275 dest = os.path.basename(os.path.normpath(source))
276 if dest == source: 276
277 ui.warn('abort: source and destination are the same\n') 277 if os.path.exists(dest):
278 sys.exit(1) 278 ui.warn("abort: destination '%s' already exists\n" % dest)
279 return 1
279 280
280 os.mkdir(dest) 281 os.mkdir(dest)
281 282
282 try: 283 try:
283 link = 0 284 link = 0