From a4777ac0c28ee214add776ebd00626c54af63ff3 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 8 Sep 2009 00:01:39 +0200 Subject: darcs: fix importing files in subdirs --- exporters/darcs/darcs-fast-import | 3 +++ exporters/darcs/t/lib.sh | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'exporters') 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() -- cgit v1.2.1