In Subversion, is it possible to check out only those files affected during a specific commit, provided you know the specific revision number?
views:
1945answers:
8svn checkout
only works at the directory level, not the file level. Of course, if all the changes in a specific changeset were from the same directory, then you can perform the svn checkout <url> <path> -r<revid>
.
I think that a Subversion check out can only check out a specific folder and not individual files. That said, the command:
svn log -r *revision* -q -v
will list the changes associated with the specified revision so you could process the output of this command to help copy the desired files to somewhere after checking out a working folder for the full directory.
You can check the list of affected files using svn log -q -v -r123 url
.
If you really only want to get the affected files you can use svn cat urlToFile -r123 > myfile
for each file.
If you're using a recent version of svn you can checkout an empty folder, then update the specific files.
after getting your list of files to select,
svn co --depth=empty url dest
cd dest
svn up file1 file2 file3
Edit: pretty much the same solution as accepted answer here: http://stackoverflow.com/questions/122107/checkout-one-file-from-subversion
I know it's a bit offtopic but I use TRAC to do this and it exports only the files modified between 2 revisions as a zip archive with the files in their original directory structure.
I think it's possible that you're using the term "check out" here in its CVS sense, that is, an "svn update". Is that right?
If so, then you can update to the particular revision that you want:
svn update -r12345
or even just those files to that revision:
svn update -r12345 file1 file2 file3
though you'll have to get the list of files from svn using some of the other suggestions.
Sorry to resurrect a long-dead question, but it was never answered to my satisfaction.
You can build a simple tool to do this for you using SVNKit. I found this blog about it, and slightly modified the code for my needs. I'm using it to this day in my deployment process.
It does an export not a checkout, but I'm sure that would be a simple change.