Subversion Partial Export

2019-02-14 20:11发布

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..." 

8条回答
男人必须洒脱
2楼-- · 2019-02-14 20:53

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?

查看更多
看我几分像从前
3楼-- · 2019-02-14 20:56

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

查看更多
Luminary・发光体
4楼-- · 2019-02-14 21:02

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.

查看更多
闹够了就滚
5楼-- · 2019-02-14 21:07

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?

查看更多
唯我独甜
6楼-- · 2019-02-14 21:08

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.

查看更多
对你真心纯属浪费
7楼-- · 2019-02-14 21:10

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.

查看更多
登录 后发表回答