subversion checkout only modified files

Hi Experts

I want to checkout / download only modified files (in specific revision range) from repository. for example in trunk from rev:100 to rev: 110 there are two modified files

trunk/index.php
trunk/path/to/file.php

like "svn up" which do it for existing working copy.  I want to do samething but without an existing working copy.
LVL 6
nasirbestAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sunnycoderCommented:
You can do svn checkout with -r option

svn co -r 110 trunk/index.php

checking out a range of revisions does not make much sense to me.

e.g. revision 99 would be a complete source file. r 100 could be just a modification of a string literal. If you were to checkout a range starting from 100, what would be the expected contents of the checked out file?

Is there some specific requirement that you are trying to accomplish through this range checkout?
0
nasirbestAuthor Commented:
@sunnycoder

thanks for your commits. but perhaps I am not much clear.

I know how to to checkout a specific revision and even how to checkout changes / diff between two revisions. what exactly I want.

1. checkout complete files which has been modified since old revision.
2. but I  do not know about which files has been modified,
3. I want to checkout these files without some existing working directory.

can someone help me?
0
sunnycoderCommented:
Try this script

It basically tries to find list of all modified files for given range of revisions and then checks out these files with highest revision number in the specified range.

If it works for you then it is trivial to paramterize it. Let me know if you need help with that.
svn log -r 100:110 http://server/path/to/trunk | grep trunk > file.list

for fname in `cat file.list`
do
       svn co -r 110 $fname
done

rm file.list

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

nasirbestAuthor Commented:
@sunnycoder

Thanks for your help. even code is incomplete and have an error. but it is directed me absolutely in right direction!. here is complete code


SVN_ROOT="http://repository.com/mysvn"
SVN_PATH="trunk"
$REV_HEAD="110"
$REV_HISTORY="100"

# get list of all modified files
svn log -qvr $REV_HEAD:$REV_HISTORY "$SVN_ROOT/$SVN_PATH" | grep trunk > file.list

# remove extra spaces & character from file.list
sed -i 's/   [A-Z] \///g' file.list 

for fname in `cat file.list`
do
    # make parent directories as I want to keep file structure
    mkdir -p ${fname%/*}
    svn export "$SVN_ROOT/$fname" "$fname"
done

rm file.list

Open in new window

0
nasirbestAuthor Commented:
Thanks for your help!
0
nasirbestAuthor Commented:
a little fix
SVN_ROOT="http://repository.com/mysvn"
SVN_PATH="trunk"
$REV_HEAD="110"
$REV_HISTORY="100"

# get list of all modified files
svn log -qvr $REV_HEAD:$REV_HISTORY "$SVN_ROOT/$SVN_PATH" | grep "$SVN_PATH" > file.list

# remove extra spaces & character from file.list
sed -i 's/   [A-Z] \///g' file.list 

for fname in `cat file.list`
do
    # make parent directories as I want to keep file structure
    mkdir -p ${fname%/*}
    svn export "$SVN_ROOT/$fname" "$fname"
done

rm file.list

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Version Control

From novice to tech pro — start learning today.