diff -r 2ca70663ded3 -r 7e5f3480c45b mercurial/hg.py --- 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"))