diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -156,11 +156,10 @@ def clone(ui, source, dest=None, pull=Fa # we lock here to avoid premature writing to the target dest_lock = lock.lock(os.path.join(dest_path, ".hg", "lock")) - # we need to remove the (empty) data dir in dest so copyfiles - # can do its work - os.rmdir(os.path.join(dest_path, ".hg", "data")) - files = "data 00manifest.d 00manifest.i 00changelog.d 00changelog.i" - for f in files.split(): + files = ("data", + "00manifest.d", "00manifest.i", + "00changelog.d", "00changelog.i") + for f in files: src = os.path.join(source, ".hg", f) dst = os.path.join(dest_path, ".hg", f) try: diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -37,7 +37,6 @@ class localrepository(repo.repository): if not os.path.exists(path): os.mkdir(path) os.mkdir(self.path) - os.mkdir(self.join("data")) else: raise repo.RepoError(_("repository %s not found") % path) elif create: diff --git a/tests/test-hup.out b/tests/test-hup.out --- a/tests/test-hup.out +++ b/tests/test-hup.out @@ -5,5 +5,4 @@ killed! transaction abort! rollback completed 00changelog.i -data journal.dirstate diff --git a/tests/test-init b/tests/test-init --- a/tests/test-init +++ b/tests/test-init @@ -56,6 +56,6 @@ echo "# check names for repositories (cl for i in bundle file hg http https old-http ssh static-http " " "with space"; do echo "# hg init \"$i\"" hg init "$i" - test -d "$i" -a -d "$i/.hg" -a -d "$i/.hg/data" && echo "ok" || echo "failed" + test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed" done