Back to Home

Solving a problem with svn: Revision range is not allowed

svn · export

Solving a problem with svn: Revision range is not allowed

    This note will be of interest to those who work with subversion and should transfer the source from the repository to the site manually, through the console.
    Not a lot of background.
    I often update the files for our project  Bookmarks on pictures (picfor.me) and for this I used the svn export ... command, but the trouble is, if I need to upload only changes between revisions, then this is not so simple in the console:
    1. $ svnexport  -r1123:1167 . /tmp/export_dir
    2. svn: Revision range is not allowed



    Of course there are solutions if you use the TortoiseSVN client, here is  an article from the Haber 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, saves the folder structure:
    1. #!/bin/bash
    2. srev=1180
    3. erev=HEAD
    4. list=`svn log -vqr$srev:$erev |egrep '^\ +[M|A]' |uniq|awk '{print "." $2 " \ "};' `
    5. tar -cjf /tmp/export.tar.gz $list



    srev and erev - specify revision numbers between which we want to get the export
    list - this is a list of files that
    export.tar.gz for export  is a ready-made archive for copying to the server.

    That's all. Perhaps there are other implementation methods. Share!

    Read Next