Search code examples
svnrevisionsvn-checkout

How can only the files that were modified in a range of SVN revisions be checked out?


Is it possible to checkout only those files from a SVN repository that were modified in a revision or range of revisions, without checking out any files that were not modified?


Solution

  • My suggestion is in the same lines as flolo suggests. But, takes a range. You could the following shell function.

    function checkout_files_in_revrange()
    {
      svn_url=$1;
      start_rev=$2;
      end_rev=$3;
      for theCheckoutCanditate in `svn log -r $start_rev:$end_rev --verbose --incremental | grep "   M " | cut -f5 -d' ' | cut -f3- -d/`
      do
         svn co $svn_url/$theCheckoutCandidate -q;
      done
    }