don't create the .hg/data at init time
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 27 Nov 2006 22:22:44 +0100
changeset 3713 8ae88ed2a3b6
parent 3712 1bd70d40ec57
child 3714 198173f3957c
don't create the .hg/data at init time
mercurial/hg.py
mercurial/localrepo.py
tests/test-hup.out
tests/test-init
--- a/mercurial/hg.py	Mon Nov 27 20:55:50 2006 +0100
+++ b/mercurial/hg.py	Mon Nov 27 22:22:44 2006 +0100
@@ -156,11 +156,10 @@
         # 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:
--- a/mercurial/localrepo.py	Mon Nov 27 20:55:50 2006 +0100
+++ b/mercurial/localrepo.py	Mon Nov 27 22:22:44 2006 +0100
@@ -37,7 +37,6 @@
                 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:
--- a/tests/test-hup.out	Mon Nov 27 20:55:50 2006 +0100
+++ b/tests/test-hup.out	Mon Nov 27 22:22:44 2006 +0100
@@ -5,5 +5,4 @@
 transaction abort!
 rollback completed
 00changelog.i
-data
 journal.dirstate
--- a/tests/test-init	Mon Nov 27 20:55:50 2006 +0100
+++ b/tests/test-init	Mon Nov 27 22:22:44 2006 +0100
@@ -56,6 +56,6 @@
 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