fix regression on empty repo cloning introduced by 0642d9d7ec80
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Fri, 29 Aug 2008 16:50:11 +0200
changeset 6944 7e5f3480c45b
parent 6943 2ca70663ded3
child 6945 2cfdabe235fb
fix regression on empty repo cloning introduced by 0642d9d7ec80 The store directory wasn't copied. Unconditionally create the directories instead.
mercurial/hg.py
tests/test-empty
tests/test-empty.out
--- a/mercurial/hg.py	Thu Aug 28 13:06:24 2008 +0200
+++ b/mercurial/hg.py	Fri Aug 29 16:50:11 2008 +0200
@@ -178,11 +178,11 @@
 
             for f in src_repo.store.copylist():
                 src = os.path.join(src_repo.path, f)
+                dst = os.path.join(dest_path, f)
+                dstbase = os.path.dirname(dst)
+                if dstbase and not os.path.exists(dstbase):
+                    os.mkdir(dstbase)
                 if os.path.exists(src):
-                    dst = os.path.join(dest_path, f)
-                    dstbase = os.path.dirname(dst)
-                    if not os.path.exists(dstbase):
-                        os.mkdir(dstbase)
                     if dst.endswith('data'):
                         # lock to avoid premature writing to the target
                         dest_lock = lock.lock(os.path.join(dstbase, "lock"))
--- a/tests/test-empty	Thu Aug 28 13:06:24 2008 +0200
+++ b/tests/test-empty	Fri Aug 29 16:50:11 2008 +0200
@@ -1,7 +1,17 @@
 #!/bin/sh
 
-hg init
+hg init a
+cd a
 hg log
 hg grep wah
 hg manifest
 hg verify
+ls .hg
+ls .hg/store
+
+cd ..
+hg clone a b
+cd b
+hg verify
+ls .hg
+ls .hg/store
--- a/tests/test-empty.out	Thu Aug 28 13:06:24 2008 +0200
+++ b/tests/test-empty.out	Fri Aug 29 16:50:11 2008 +0200
@@ -3,3 +3,19 @@
 crosschecking files in changesets and manifests
 checking files
 0 files, 0 changesets, 0 total revisions
+00changelog.i
+requires
+store
+updating working directory
+0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+0 files, 0 changesets, 0 total revisions
+00changelog.i
+branch
+dirstate
+hgrc
+requires
+store