Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can 'svn switch' be slower than 'rm -rf && svn checkout'?

Suppose that my working copy ~/WC/ is up to date with http://acme.com/svn-rep/A/. Now i would like that same working copy be up to date with http://acme.com/svn-rep/B/. I have two options:

  1. svn switch http://acme.com/svn-rep/B/ ~/WC/
  2. rm -rf ~/WC/ && svn co http://acme.com/svn-rep/B/ ~/WC/

Obviously, the best case of option 1 is faster than then best case of option 2. But can there be a case where for the worst case, option 1 is slower than the worst case than option 2?

The reason i am asking is that i am writing a bunch of scripts to automate some testing, and i will need to work on several branches within the same repository. There is a limited amount of disk space on the test machines, so i will have to reuse the same working copy.

EDIT:

After reading the link in aix's answer below, there appears to be a third option:

  • svn cleanup ~/WC/ && svn switch http://acme.com/svn-rep/B/ ~/WC/
like image 914
zr. Avatar asked Nov 05 '22 06:11

zr.


1 Answers

I haven't personally experienced this, but it would appear that there could be performance issues with svn switch: Slow switch in subversion

It's hard to say whether rm && svn co would be faster or slower in those circumstances. I'd imagine this would depend on the relative performance of your local disk, network connection to the svn server etc.

That said, I personally would probably use svn switch in the first instance, and would look into alternatives only if I run into problems.

like image 196
NPE Avatar answered Nov 09 '22 06:11

NPE