mercurial/hg.py
changeset 3853 c0b449154a90
parent 3851 8f18e31c4441
child 3854 4f6db0233606
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -157,11 +157,15 @@ def clone(ui, source, dest=None, pull=Fa
                     raise
 
         src_store = os.path.realpath(src_repo.spath)
-        dest_path = os.path.realpath(os.path.join(dest, ".hg"))
-        dest_store = dest_path
         if not os.path.exists(dest):
             os.mkdir(dest)
+        dest_path = os.path.realpath(os.path.join(dest, ".hg"))
         os.mkdir(dest_path)
+        if src_repo.spath != src_repo.path:
+            dest_store = os.path.join(dest_path, "store")
+            os.mkdir(dest_store)
+        else:
+            dest_store = dest_path
         # copy the requires file
         force_copy(src_repo.join("requires"),
                    os.path.join(dest_path, "requires"))