This note will be interesting to those who work with subversion and should transfer the source code from the repository to the site in “manual”, through the console.
Not a lot of background.
I often update the files for our project
Bookmarks to pictures (picfor.me) and used the svn export command for this ... but the problem is that if I only need to upload changes between revisions, then it’s not so easy to use in the console:
$ svn export -r1123: 1167 . / tmp / export_dir svn : Revision range is not allowed
$ svn export -r1123: 1167 . / tmp / export_dir svn : Revision range is not allowed
There are certainly solutions, if you use the TortoiseSVN client, here is
an article from the habr where it is described.
I came up with a solution for the console.
')
Here is a simple bash script that solves this problem in the console and, moreover, preserves the folder structure:
- #! / bin / bash
- srev = 1180
- erev = HEAD
- list = ` svn log -vqr $ srev : $ erev | egrep '^ \ + [M | A]' | uniq | awk '{print "." $ 2 "\"}; ' `
- tar -cjf / tmp / export.tar.gz $ list
srev and erev - specify the number of revisions between which we want to get the export
list is a list of files for export
export.tar.gz - ready archive for copying to the server.
That's all. Perhaps there are other ways to implement. Share!