# HG changeset patch # User Jeff Hammel # Date 1321335174 28800 # Node ID 423b67ff451272e087b7df083640fdcb76c61437 # Parent d495b610046a249813762f63a6b085e96266672a more stubbing diff -r d495b610046a -r 423b67ff4512 fetch.py --- 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):