开发者

How can I get all the versions of a given file?

开发者 https://www.devze.com 2022-12-30 04:16 出处:网络
I would like to obtain all the versions of a given file in my SVN repository. For instance, let\'s say that the file ThirdPartyAssembly.dll was checked 3 times, is t开发者_C百科here a command that wil

I would like to obtain all the versions of a given file in my SVN repository. For instance, let's say that the file ThirdPartyAssembly.dll was checked 3 times, is t开发者_C百科here a command that will get me all the version on my HD (e.g. ThirdPartyAssembly.dll.v1, ThirdPartyAssembly.dll.v2, ThirdPartyAssembly.dll.v3, etc.)?

Thanks!


  1. Right click with mouse on the selected file ThirdPartyAssembly.dll in your working copy on your HD, and a popup menu appears.

  2. From the popup menu choose on TortoiseSVN > Show log, and a window appears

  3. The window contains the list of ALL the checked in versions of your file

  4. RIGHT click mouse on the one that you want, a pop up menu appears.

  5. Form the popup menu choose "Save revision to..." and you can save it on your HD wherever you like.


there is no command out of the box but you can build simple script that uses log -q command output.

zerkms@honeypot /var/www/cv $ svn log -q index.html
------------------------------------------------------------------------
r17 | zerkms | 2010-04-21 21:47:16 +1100 (Wed, 21 Apr 2010)
------------------------------------------------------------------------
r16 | zerkms | 2010-04-21 21:37:03 +1100 (Wed, 21 Apr 2010)
------------------------------------------------------------------------
r15 | zerkms | 2010-04-21 21:36:46 +1100 (Wed, 21 Apr 2010)
------------------------------------------------------------------------
r14 | zerkms | 2010-04-21 21:32:37 +1100 (Wed, 21 Apr 2010)
... etc

so you just need to parse first column in your favorite scripting language

after this just do:

svn copy http://server/full/path/to/file@14 file.rev.14

etc, for each revision and you will get bunch of file.rev.XX


You could just run a diff command on each version to get CVS to generate copies of the old files. You could probably even script this if there are a lot of old revisions.

But that said, what exactly are you really trying to do here? Maybe there is a better way?

0

精彩评论

暂无评论...
验证码 换一张
取 消