user1189180
user1189180

Reputation: 11

SVN Checkout based on Author

How to checkout files from a folder based on author name ..for eg in a folder there are 100 of files created by more tahn 10 users i have to checkout or export only the files created by a specific user ..is it possible? i tried svnlook but thats not the correct way

Upvotes: 0

Views: 243

Answers (1)

mliebelt
mliebelt

Reputation: 15525

Checkout is the wrong term here. Even when doing sparse checkouts in Subversion, there is no option to filter parts of the files directly.

It should be possible to create a batch file / shell script with the following parts:

  1. Iterate over all files of the directory.
  2. Call for each file the command svn info <filename>.
  3. Filter from the output the line: Last Changed Author: <author>. As the output tells, it is the author of the last change. If you are interested in the first author, this should be available through the command svn log <filename> with some additional filtering.
  4. Copy that file to a location where you want it to be.

If you want the files to be under version control of Subversion, you have to do a checkout, but then filter all files not from the author:

  1. Do a checkout of that directory (files only) by: svn checkout --depth files.
  2. Iterate over all files, and execute for each file not from the author: svn update --set-depth exclude <filename>.

Upvotes: 2

Related Questions