tags:

views:

2431

answers:

9

I have somewhat interesting development situation. The client and deployment server are inside a firewall without access to the Subversion server. But the developers are outside the firewall and are able to use the Subversion server. Right now the solution I have worked out is to update my local copy of the code and then pull out the most recently updated files using UnleashIT.

The question is how to get just the updated files out of Subversion so that they can be physically transported through the firewall and put on the deployment server.

I'm not worried about trying to change the firewall setup or trying to figure out an easier way to get to the Subversion server from inside the firewall. I'm just interested in a way to get a partial export from the repository of the most recently changed files.

Are there any other suggestions?

Answer found: In addition to the answer I marked as Answer, I've also found the following here to be able to do this from TortoiseSVN:

from http://svn.haxx.se/tsvn/archive-2006-08/0051.shtml

* select the two revisions
* right-click, "compare revisions"
* select all files in the list
* right-click, choose "export to..."
A: 

You don't provide information on what is allowed through the firewall. I'm not familiar with UnleashIT.

I guess you could have a script that exports from SVN to a folder on the SVN server. The script then zips the exported files. You can then transport the ZIP file however you want and extract to the deployment server.

TortoiseSVN supports proxy servers so you could use one of those from the client's side?

BrianLy
A: 

You could try playing around with the svnadmin dump command that ships with the Subversion binaries. You can use this command to dump the whole repository to a file, just certain revision, or a range of revisions. Then use svnadmin load to load the dump-file into a new, clean repository.

Not a perfect solution since it works in terms of the repository and not individual files.

Craig
+1  A: 

So if I understand correctly...

Let's say you have a repository that looks like this:

/
|+-DIR1
|   |- FILEa
|   |- FILEb
|+-DIR2
|   |- FILEc
|   |- FILEd
|- FILEe
|- FILEf

And let's say you update files FILEa, FILEc, and FILEf and commit them back into the repository. Then what you want to export out of the repository is a structure that looks like this:

/
|+-DIR1
|   |- FILEa
|+-DIR2
|   |- FILEc
|- FILEf

Is that right?

Dylan Bennett
A: 

You just want the people who are behind the firewall to be able to access the latest files committed to Subversion, right?

Could you write an svn hook script that uses some method (maybe scp or ftp) to send the files over to the remote location at the time they're committed?

Mark Biek
A: 

The Subversion hooks looks like it has a lot of promise. But being relatively uninformed about how to script the hook, how would I pull out the files that were committed and FTP them somewhere maintaining the directory structure?

If I could do that, then someone inside the firewall can pull the files down to the deployment server and we'd be good to go.

Jared
+1  A: 

I've found rsync extremely useful for synchronizing directory trees across multiple systems. If you have shell access to your server from a development workstation, you can regularly check out code locally and run rsync, which will transfer only the files that have changed to the server.

(This assumes a Unix-like environment on your development workstations. Cygwin will work fine.)

cd deploy
svn update
rsync -a . server:webdir/

Your question sounds like you don't actually have any direct network access from your development workstations to your server, and what you're really looking for is a way to get Subversion to tell you which files have changed. svn export supports an argument to let you check out only the files that changed between particular revisions. From the svn help:

  -r [--revision] arg      : ARG (some commands also take ARG1:ARG2 range)
                             A revision argument can be one of:
                                NUMBER       revision number
                                '{' DATE '}' revision at start of the date
                                'HEAD'       latest in repository
                                'BASE'       base rev of item's working copy
                                'COMMITTED'  last commit at or before BASE
                                'PREV'       revision just before COMMITTED

You'll need to keep track of what the latest revision you copied to the server. Assuming it's SVN revision xxxx:

svn export -r xxxx:HEAD http://svn/

Then simply copy the contents of the deploy directory to your server on top of the existing files.

This won't handle deleted files, which may prove problematic in some environments.

Commodore Jaeger
+2  A: 

svn export does not accept a revision range, try it out.

A possible solution is to get the list of changed files with:

svn diff --summarize -rXXX http://svn/...

and then export each of them.

bolk
A: 

I'm under Linux so I miss SVNTortoise. If it can help I wrote down a little script, available at http://www.falconnet.fr/Subversion-export-des-fichiers.html. The paper is in french but the script is in english.

Let's hope, it will help.

Jfalconnet
A: 

If you tag the revisions this may help github svn-diff-export

Phil Gloyne