Fix file trees copying

Create the directories in advance to copying files,
not later, becase this caused some destination path
problems, like not appending the filename to the
destination directory, because it didn't exist.
This commit is contained in:
Martin Gracik 2010-07-14 15:57:19 +02:00
parent d216a61811
commit aaef55c007

View File

@ -234,8 +234,8 @@ class SmartCopy(object):
self.__copy_link(src_path, dst_path, src, new_dst, dir=True)
else:
# create the destination directory
if not os.path.isdir(new_dst) and new_dst not in self.makedirs:
self.makedirs.append(new_dst)
if not os.path.isdir(new_dst):
makedirs_(new_dst)
elif os.path.isfile(new_dst):
err_msg = "cannot overwrite file '{0}' with directory"
err_msg = err_msg.format(new_dst)