tags:

views:

2525

answers:

7

Does anyone know how to export only the changed files from two tags using svn?

Lets say I have tag 1.0 and then later fix bugs in the trunk. Next I am ready for a new patch release so I tag it 1.1. Now I want to export the changed files between tag 1.0 and 1.1. Is this possible?

+1  A: 

svn diff can create a diff representing the changes between to tags. You can apply that diff with the patch utility.

http://svnbook.red-bean.com/en/1.0/re09.html

+2  A: 

svn diff --summarize url/to/tag1.0 url/to/tag1.1

will give you a list of files that changed between those two tags. You should be able to parse that list in a script and export each file individually with either

svn export url/to/file filepath

or

svn cat url/to/file > file

If you're using TortoiseSVN:

  • open the repository browser, browse to tag1.0, right-click, choose "mark for comparison"
  • browse to tag1.1, right-click, choose "compare urls"
  • in the file diff dialog, select all files/folders that changed between the tags (Ctrl+A)
  • right-click, choose "export to..."
Stefan
when i select all export to does not exists, it works for one file only :-/
msony
A: 

I think this would handle what you are trying to do:

http://stackoverflow.com/questions/42246/subversion-partial-export

Jared
+1  A: 

I had the same problem. I wrote down a little script. If it can help somebody, feel free to reuse (it's GPL). http://www.falconnet.fr/Subversion-export-des-fichiers.html

Hope it'll help.

Jfalconnet
A: 

We needed something like this too. So I wrote a small java tool.

Hope it's useful to someone: github svn-diff-export

Phil Gloyne
A: 

This is my solution for TortoiseSVN:

  • Open the repo browser.
  • Right click tag1 and select "Mark for comparison"
  • Right click tag2 and select "Compare URLs"
  • Select All (Ctrl+A) in the list of files
  • Right click and "Export selection to..."
  • Enter a destination directory and press OK

What ends up exported is all the files you need to write over the top of an existing export in order to update it (no messing around applying diffs). Useful, for example, for updating websites by FTP.

The only caveat is that it obviously won't handle deleted files. Although it will at least tell you which files need to be deleted manually.

Andrew Russell
A: 
  1. Using TortoiseSVN, right-click on your working folder and select “Show Log” from the TortoiseSVN menu.

  2. Click the revision that was last published (#85 in this example)

  3. Ctrl+Click the HEAD revision (or whatever revision you want to release ie #178) so that both the old and the new revisions are highlighted.

  4. Right-click on either of the highlighted revisions and select “Compare revisions.” This will open a dialog window that lists all new/modified files.

  5. Select all files from this list (Ctrl+a) then right-click on the highlighted files and select “Export selection to…”

Source: http://www.verysimple.com/blog/2007/09/06/using-tortoisesvn-to-export-only-newmodified-files/

Rachin Kapoor