0

I want to get only specific files using svn command line utlity.

I've a batch script that gets only specific files from vss, using ss tool of vss.

In vssthe command is:

ss get *.c

I need similar functionality with svn command utility. How can I start ?

Lakshman Rao
  • 115
  • 1
  • 11

1 Answers1

1

You can try something like, get the file list which are matching some extension, like .txt or .c.

svn list -R http://svn/url/till/the/path/you/need/ | grep ".extension"

Then for every line in the output of the above command use svn export to get the files in your local machine.

Edit:

repository=http://svn/url/till/the/path/need/

$target_directory=some path in machine

for line in svn list -R http://svn/url/till/the/path/need/ | grep ".extension" do

  filename=`echo "$line" |sed "s|$repository||g"`

  if [ ! -d $target_directory$filename ]; then
     directory=`dirname $filename`
    mkdir -p $target_directory$directory
   svn export --force -r HEAD $repository$line $target_directory$filename --username abc --password password123

fi

done

Dipu H
  • 2,372
  • 15
  • 24
  • How to store the result and access each entry? If I use `export` on the result, would the files be retrieved recursively ? – Lakshman Rao Jan 29 '14 at 05:51