# HG changeset patch # User Jeff Hammel # Date 1321398010 28800 # Node ID 72d461e2ccbd91899e73cb43937b7169be58034e # Parent fb05b7616bd8794d26c756cfcffc6383a528adeb more stubbing of copytree diff -r fb05b7616bd8 -r 72d461e2ccbd fetch.py --- a/fetch.py Tue Nov 15 14:53:08 2011 -0800 +++ b/fetch.py Tue Nov 15 15:00:10 2011 -0800 @@ -25,6 +25,8 @@ "The destination directory must not already exist." """ + assert os.path.exists(src), "'%s' does not exist" % src + # if its a file, just copy it if os.path.isfile(src): shutil.copy2(src, dst) @@ -37,7 +39,15 @@ else: os.makedirs(dst) + src = os.path.realpath(src) for dirpath, dirnames, filenames in os.walk(src): + for d in dirnames: + pass + for f in filenames: + path = os.path.join(dirpath, f) + _dst = os.path.join(dst, os.path.relpath(path, src)) + import pdb; pdb.set_trace() +# shutil.copy2(path import pdb; pdb.set_trace() class Fetcher(object): @@ -174,6 +184,8 @@ dest = os.path.abspath(dest) tmpdir = tempfile.mkdtemp() self.clone(tmpdir) + if self.vcs_dir: + shutil.rmtree(os.path.join(tmpdir, self.vcs_dir)) path = tmpdir if self.subpath: path = os.path.join([tmpdir] + self.subpath)