summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorMatthew Buckett <matthew.buckett@oucs.ox.ac.uk>2009-07-11 09:43:47 -0400
committerShawn O. Pearce <sop@google.com>2010-05-27 18:05:26 -0700
commit2daf66740bba0b2726462a547910d16cf0822db2 (patch)
tree45139dbc584bdbe297eaea71e6ff71822eaab751 /project.py
parentf4f04d9fa8fda995974c9214eee42c3ea68b1125 (diff)
downloadgit-repo-2daf66740bba0b2726462a547910d16cf0822db2.tar.gz
Allow files to be copied into new folders
Change-Id: I7f169e32be5a4328bb87ce7c2ff4b6529e925126
Diffstat (limited to 'project.py')
-rw-r--r--project.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/project.py b/project.py
index ff896d01..1bcd9596 100644
--- a/project.py
+++ b/project.py
@@ -203,6 +203,10 @@ class _CopyFile:
203 # remove existing file first, since it might be read-only 203 # remove existing file first, since it might be read-only
204 if os.path.exists(dest): 204 if os.path.exists(dest):
205 os.remove(dest) 205 os.remove(dest)
206 else:
207 dir = os.path.dirname(dest)
208 if not os.path.isdir(dir):
209 os.makedirs(dir)
206 shutil.copy(src, dest) 210 shutil.copy(src, dest)
207 # make the file read-only 211 # make the file read-only
208 mode = os.stat(dest)[stat.ST_MODE] 212 mode = os.stat(dest)[stat.ST_MODE]