changeset 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 0e9234a1a3f6
children b8404005d6d5
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Jun 30 08:44:22 2005 -0800
+++ b/mercurial/commands.py	Thu Jun 30 08:47:31 2005 -0800
@@ -273,9 +273,10 @@
 
     if dest is None:
         dest = os.path.basename(os.path.normpath(source))
-        if dest == source:
-            ui.warn('abort: source and destination are the same\n')
-            sys.exit(1)
+
+    if os.path.exists(dest):
+        ui.warn("abort: destination '%s' already exists\n" % dest)
+        return 1
 
     os.mkdir(dest)