subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Hoffman <geoff.hoff...@jawa.com>
Subject Re: can I checkout only a revision files ?
Date Wed, 20 Oct 2010 15:28:14 GMT
> On Wed, Oct 20, 2010 at 09:17, Andrea Antonio Maleci
> <A.Maleci@iwbank.it> wrote:
> Is it possible to checkout only files (not patch, but entire files)
> from a specific revision ?
> 
> From: Andy Levy [mailto:andy.levy@gmail.com] 
> Yes, use the --revision option for svn co.
>
> ---- "Andrea Antonio Maleci" <A.Maleci@iwbank.it> wrote:
>
> It retrieves entire repository at specified revision, not only the
> modified one...


Right, 

As others have said, you cannot 'svn co' files, 
you can only checkout directories.

The ability to export files exists, but to export 
only modified files is not built in, either. 

I've been trying to learn Bash scripting better 
and wrote the following.

If you're on Windows, install Cygwin. 

It may not be exactly what you 
want, because it exports the files 
instead of checking them out.

You have to do something like...

svn log --verbose -r 2345 | grep M > files.txt

...then something like... (vi svncomod.sh)

#!/bin/bash
FILE=$1
REPO=$2
while read line
do
    for ARG in $line; do
        F=${ARG}
        if [ "$F" != M ]
          then
            echo ${REPO}${F}
            svn export ${REPO}${F}
        fi
    done
done < ${FILE}

... then...

chmod +x svncomod.sh

...and finally...

svncomod.sh files.txt http://path-to/repo

Mime
View raw message