diff --git a/hgsvn/run/hgimportsvn.py b/hgsvn/run/hgimportsvn.py
index 959d065..371041c 100644
--- a/hgsvn/run/hgimportsvn.py
+++ b/hgsvn/run/hgimportsvn.py
@@ -223,8 +223,11 @@ def main():
# in the local case the files here already
if not options.local_only:
# Move SVN working copy here (don't forget base directory)
+ # subversion >= 1.7: just one .svn/ dir
for d in chain([""], svn_dirs):
- os.rename(os.path.join(checkout_dir, d, svn_private_dir), os.path.join(d, svn_private_dir))
+ meta_dir = os.path.join(checkout_dir, d, svn_private_dir)
+ if os.path.exists(meta_dir):
+ os.rename(meta_dir, os.path.join(d, svn_private_dir))
finally:
# in the local case the checkout_dir is the target, so don't delete it