Skip to content


Subversion: Export changed Files in a revision range

A friend of mine asked  me if  subversion has a function to export changed Files in a revision range, because she want to send the zipped exported directory to customer to overwrite the old version. After googled, I find a Windows BAT(with linux tools) , a java and a TortoiseSVN solution.  I think the solutions above all have its own defect, So I decided to write a cross platform script with python.

The script is  here: http://svn-script.googlecode.com/svn/trunk/tools/svnchanged_export.py. This script needs python 2.5 or greater and pysvn. To export files changed between 20 and HEAD(newest) at URL svn://192.168.101.1/lynx/trunk/ to directory dist, we can input:

python svnchanged_export.py -u username -p password -r 20:HEAD svn://192.168.101.1/lynx/trunk/ dist

The exported files will organized as the original structure, and the revision is HEAD. The -u(–username) and (-p)(–password) is optional. If omited, the script may use the cached authentication information.  The files will export to directory dist. The -r(–revision) also accept integer value like “-r 10:20″, then the exported file’s revision would be 20.

Any problems can comment here.

Related posts:

  1. Subversion导出修订版本范围中修改过的文件
  2. 上传工作拷贝中改变的文件
  3. Subversion 1.5发布说明
  4. Dreamhost上编译Subversion
  5. Resize Image In Context Menu

Posted in recommend, subversion. Tagged with , , , , .

10 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Marcin said

    Great software, easy to install and really works.

  2. @Marcin

    Happy to know.

  3. tricker said

    your script saved my life. thank you!

  4. Hello, i have some problems with urlparse in dreamhost, but i used this way, replacing right vars:
    scheme = urlObject[0];
    netloc = urlObject[1];
    path = urlObject[2];

    after this problem solved i got other:

    python: /mnt/host/home/absurd/src/debian/etch-bpo/subversion/subversion-1.5.1dfsg1/subversion/libsvn_subr/path.c:350: svn_path_remove_component: Assertion `is_canonical(path->data, path->len)’ failed.
    Aborted

    By default, DreamHost uses Python 2.4.4.

    I used follow command line in shell:
    python /home/user/domain.com/teste.py -u username -p password -r 40:HEAD http://svn.domain.com/project/trunk/ /home/user/domain.com/

  5. @rocksun
    your script rocks !! its will save my life too… but im not familiar with python and shell commands.. try to help me :)

    i tried
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project dist
    - output
    UTF-8
    http://svn.domain.com/project/dist
    - receive
    File “/home/user/domain.com/teste.py”, line 88, in ?
    summary = client.diff_summarize(url, revision_min, url, revision_max)
    pysvn._pysvn.ClientError: Path ‘http://svn.domain.com/project/’ is not canonicalized; there is a problem with the client.

  6. continue…

    i tried too with and without trainling slashes as i read in your link…
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk dist
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk dist/
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk/ dist
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk/ dist/

    and the output is the same

    python: /mnt/host/home/absurd/src/debian/etch-bpo/subversion/subversion-1.5.1dfsg1/subversion/libsvn_subr/path.c:350: svn_path_remove_component: Assertion `is_canonical(path->data, path->len)’ failed.
    Aborted

  7. continue..

    i tried too with and without trainling slashes as i read in your link…
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk dist
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk dist/
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk/ dist
    $ python /home/user/domain.com/teste.py -r 42:HEAD http://svn.domain.com/project/trunk/ dist/

    and the output is the same

    python: /mnt/host/home/absurd/src/debian/etch-bpo/subversion/subversion-1.5.1dfsg1/subversion/libsvn_subr/path.c:350: svn_path_remove_component: Assertion `is_canonical(path->data, path->len)’ failed.
    Aborted

  8. @Vitor Almeida

    I have not test it with python 2.4.
    Could you install a python 2.6 on dreamhost?

  9. @rocksun
    u can delete duplicated post pls..
    I can install on dh yes… i have this tuto http://wiki.dreamhost.com/Python#Virtualenv

    but i dont have expertise to do that.. but i can try..

    im thinking, if the msg error is the same of reported in your link.. u think the problem is with python version ??

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.