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:
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.