Question

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 ?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top