diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2009-09-08 00:01:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2009-09-08 00:01:39 +0200 |
commit | a4777ac0c28ee214add776ebd00626c54af63ff3 (patch) | |
tree | f3d661684a667dd7ab3b17dc506a017cf1877a38 /exporters | |
parent | b4bf1987ebe44067012ffb0a0748a1f782dba38c (diff) | |
download | bzr-fastimport-a4777ac0c28ee214add776ebd00626c54af63ff3.tar.gz |
darcs: fix importing files in subdirs
Diffstat (limited to 'exporters')
-rwxr-xr-x | exporters/darcs/darcs-fast-import | 3 | ||||
-rw-r--r-- | exporters/darcs/t/lib.sh | 4 |
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() |