jkphl
jkphl

Reputation: 181

Duplicating a working copy in SVN?

First I will describe our SVN setup for our website. Our development server hosts the trunk I will call that dev.mysite.com. We have several working copies checked out: my local environment, external developers local environment, and our production environment called www.mysite.com. Files are edited and tested locally and committed to the trunk when they look good and a post-commit hook auto updates them there. Functionality is tested on the dev.mysite.com and if everything is still fine, I SSH into www.mysite.com and update the necessary files pushing it live to our customers.

Our problem is that our external developer is going to do a major update and wants to make absolutely sure there is going to be no problems on launch by pushing to another staging server before production. The standard method would be to create a new subdomain (stage.mysite.com) and checkout a working copy. However the major release files have already been committed so that defeats the purpose.

So my question is: Is it possible to duplicate exactly the working copy that resides on our production server www.mysite.com and put it on stage.mysite.com? So if I were to run an svn status -u on stage.mysite.com it would show the same out of date files that were on the production working copy?

Any help is appreciated!

Upvotes: 0

Views: 1865

Answers (1)

TwentyMiles
TwentyMiles

Reputation: 4089

The answer to this question hinges on what you mean by "out of date files." If you mean files that have not been committed, the only way to duplicate your working copy onto another machine is by manually copying the files using whatever mechanism is available in your environment (cp, scp, xcopy, etc). The good news is that there is nothing tricky involved with this. You can just copy the entire working directory to the new maching and go about your business. SVN doesn't care if you have multiple copies of a working directory; there is nothing special or unique abut the files in the .svn folder. If you are using SVN > 1.7, however, you will need to make sure that you take the entire hierarchy of the working copy, since there is only a single .svn folder in the root directory and sub directories have no special metadata.

If by "out of date files" you mean that all of your files are in subversion, but that in one of your working copies you have not run "svn update," then you can replicate that working directory by specifying a revision when you check out the project into your new working directory.

svn checkout -r {revision number before changes} svn://{repo path} {name of new working directory}  

Upvotes: 2

Related Questions