summaryrefslogtreecommitdiff
path: root/exporters
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2009-09-08 00:01:39 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2009-09-08 00:01:39 +0200
commita4777ac0c28ee214add776ebd00626c54af63ff3 (patch)
treef3d661684a667dd7ab3b17dc506a017cf1877a38 /exporters
parentb4bf1987ebe44067012ffb0a0748a1f782dba38c (diff)
downloadbzr-fastimport-a4777ac0c28ee214add776ebd00626c54af63ff3.tar.gz
darcs: fix importing files in subdirs
Diffstat (limited to 'exporters')
-rwxr-xr-xexporters/darcs/darcs-fast-import3
-rw-r--r--exporters/darcs/t/lib.sh4
2 files changed, 7 insertions, 0 deletions
diff --git a/exporters/darcs/darcs-fast-import b/exporters/darcs/darcs-fast-import
index 2955164..e4392e7 100755
--- a/exporters/darcs/darcs-fast-import
+++ b/exporters/darcs/darcs-fast-import
@@ -194,6 +194,9 @@ class Handler:
elif self.line.startswith("M "):
items = self.line.split(' ')
path = items[3][:-1]
+ dir = os.path.split(path)[0]
+ if len(dir) and not os.path.exists(dir):
+ os.makedirs(dir)
sock = open(path, "w")
if items[2] != "inline":
idx = int(items[2][1:])
diff --git a/exporters/darcs/t/lib.sh b/exporters/darcs/t/lib.sh
index 3df0a8a..d82f6a8 100644
--- a/exporters/darcs/t/lib.sh
+++ b/exporters/darcs/t/lib.sh
@@ -172,6 +172,10 @@ third line" | hg commit -l /dev/stdin
hg commit -m "add empty file"
hg rm file3
hg commit -m "remove file"
+ mkdir subdir
+ echo test > subdir/file
+ hg add subdir/file
+ hg commit -m "add subdir file"
cd ..
}
create_git()