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:
11 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Great software, easy to install and really works.
@Marcin
Happy to know.
your script saved my life. thank you!
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/
@Vitor Almeida
http://us.generation-nt.com/bug-320755-rapidsvn-assertion-canonical-path-data-path-len-failed-help-166012621.html
I think you can try it.
@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.
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
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
@Vitor Almeida
I have not test it with python 2.4.
Could you install a python 2.6 on dreamhost?
@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 ??
so many problem, when running this Script, overload memory on my PC. (total 2G memory)
hope have new version.