mercurial/commands.py
changeset 523 003df62ae39f
parent 522 2f1de824798a
child 525 337163e4d4b9
--- a/mercurial/commands.py	Wed Jun 29 13:48:57 2005 -0800
+++ b/mercurial/commands.py	Wed Jun 29 14:04:56 2005 -0800
@@ -272,10 +272,12 @@
     success = created = False
 
     if dest is None:
-        dest = os.getcwd()
-    elif not os.path.exists(dest):
-        os.mkdir(dest)
-        created = True
+        dest = os.path.basename(source)
+        if dest == source:
+            ui.warn('abort: source and destination are the same\n')
+            sys.exit(1)
+
+    os.mkdir(dest)
 
     try:
         dest = os.path.realpath(dest)