Mercurial > hg > fetch
changeset 27:423b67ff4512
more stubbing
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 14 Nov 2011 21:32:54 -0800 |
parents | d495b610046a |
children | 5ecb6507931b |
files | fetch.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/fetch.py Mon Nov 14 21:25:56 2011 -0800 +++ b/fetch.py Mon Nov 14 21:32:54 2011 -0800 @@ -150,11 +150,15 @@ assert os.path.isdir(dest), "source is a directory; destination is a file" else: os.makedirs(dest) + shutil.copytree(path, dest) else: - if os.path.exists(dest): - assert os.path.isfile(dest), "" - else: + if not os.path.exists(dest): directory, filename = os.path.split(dest) + if os.path.exists(directory): + assert os.path.isdir(directory), "%s is not a directory" % directory + else: + os.makedirs(directory) + shutil.copy(path, dest) shutil.rmtree(tmpdir) def clone(self, dest):