[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: can I checkout only a revision files ?

From: Geoff Hoffman <geoff.hoffman_at_jawa.com>
Date: Wed, 20 Oct 2010 08:28:14 -0700 (MST)

> On Wed, Oct 20, 2010 at 09:17, Andrea Antonio Maleci
> <A.Maleci_at_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_at_gmail.com]
> Yes, use the --revision option for svn co.
>
> ---- "Andrea Antonio Maleci" <A.Maleci_at_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
Received on 2010-10-20 17:28:51 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.