SVN export just the changed files from tags

前端 未结 6 916
挽巷
挽巷 2021-02-09 20:23

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

相关标签:
6条回答
  • 2021-02-09 20:40

    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

    0 讨论(0)
  • 2021-02-09 20:45

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

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

    0 讨论(0)
  • 2021-02-09 20:45

    Based on Stefan's idea:

    REV=123456
    URL=https://...
    BASEDIR=some_dir
    svn diff --summarize -c $REV $URL | while read A B; do 
        svn cat -r $REV $B > ${B##*$BASEDIR}
    done
    
    0 讨论(0)
  • 2021-02-09 20:48

    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.

    0 讨论(0)
  • 2021-02-09 20:51
    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/

    0 讨论(0)
  • 2021-02-09 21:01

    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..."
    0 讨论(0)
提交回复
热议问题