tags:

views:

86

answers:

2

I have a version controlled project located at ~/webapps/django/myproject and media files located at ~/webapps/static. I want to add the static folder to the same repo so that when it's checked out, it will be in the project folder, preferably with the name "media".

I've tried going into the webapps folder and doing svn import static https://myrepo but it imports all the stuff inside static, but excludes the "static" folder itself, making a big mess in my project folder.

If you're wondering, I'm doing this because there's a bit of a discrepancy in the way my development server and production server are set up.

A: 

You could move or copy static into the project folder and type:

svn add static
svn commit -m "adding static folder"
ChrisH
Er... I want to keep it where it is.
Mark
So then I'm confused by your requirement: "...so that when it's checked out, it will be in the project folder"
ChrisH
Yes, *(only) when it's checked out*. I was configuring my dev server, and the two folders need to stay where they are on there. However, on my local/working machine, I want to check out *everything* and have them in the same folder.
Mark
I understand better now. How do you plan to keep the dev server directory structure from being altered the next time you do an svn update there?
ChrisH
+2  A: 

You are already very close.

svn import static https://myrepo/media

Would place the contents of static into the path myrepo/media on the server, even if media does not yet exist. Note that if there are intervening paths that do not yet exist in the repository, Subversion will recursively create them. For example, svn import static https://myrepo/intervening/media would:

  1. create the path intervening if it does not exist
  2. create the path media if it does not exist
  3. import the contents of static into the repo path
Patrick Johnmeyer
Crossed my mind, but I didn't think it would work for some reason. I'll assume this works, thanks :)
Mark