How to export changed files between two SVN revisions

前端 未结 6 1040
旧时难觅i
旧时难觅i 2021-02-09 00:57

How can I export changed files in SVN that have changed between two revisions. I need a solution either via command line or by using any scripts (with proper folder structure).

6条回答
  •  执念已碎
    2021-02-09 01:44

    Although the post by @Hoodi may work if one is able to us a C# solution, the post by @kicken is extremely efficient as a windows solution.

    Unfortunately I found no way to use the repository. I had to check out the revision I need to a directory first, then run the script on the "working copy" directory.

    I was unable to use it as posted however. This little re-write worked for me:

    FOR /F "tokens=1,2,3" %%I IN ('svn diff --summarize -r %1 %3') DO (
        IF NOT %%I == D (
            IF NOT EXIST %2\ mkdir %2\
            svn export --depth empty -q --force %%J %2
            echo exported: %2
        )
    )

    To run it needs the SVN_URL as well:

    C:\YourRepository>svnexport.bat 1:10 C:\Export 

    (I know this was a very old post, but THANK YOU @kicken for ending my LONG search for solution)

提交回复
热议问题