57

Situation - have enormous repository, slow and unreliable link (read - vpn that breaks from time to time).

We are subject of frequent branching, moving things, so every now and then whole new branch should be taken from the repository (checkout).

Is there a way to 'resume' broken checkouts? Is it safe to do svn checkout with same parameters and expect it to skip what is downloaded and download what is not?

Daniel Mošmondor
  • 19,718
  • 12
  • 58
  • 99
  • Have you considered to use a DVCS as client to subversion? – Rudi Oct 28 '10 at 11:08
  • Excellent question, still legit. Ie I have to checkout some publicly available source from svn now, but the link also sucks - so there are use-cases for this without DVCS into question. – Zlatko Aug 14 '12 at 18:26

7 Answers7

86

Just ran into the same problem. I had to interrupt a checkout because it was taking an absurdly long time. When I went to "resume" the checkout, it wasn't clear whether I should re-initiate the checkout or simply do an svn update.

After attempting to to do the svn update to resume the checkout, I got a wonderful error message saying that the directory was "locked". I tried issuing a "Release Lock" from Tortoise SVN, but this didn't help.

Ultimately, what I ended up having to do was issue an svn cleanup to release whatever stranglehold Subversion had in place. After that, I was able to continue my previously initiated checkout by performing kicking off another update (svn update or "SVN Update" from the Tortoise SVN context menu).

Marc
  • 886
  • 7
  • 4
  • But there is no project to do SVN update on, until the checkout is finished ? what to do then ? ...and if I try re-doing the checkout... it says it can;t be done to a folder that is not empty.... I don;t want to start with an empty folder again.... as disconnect might happen again... how to resume ? – CthulhuJon Dec 01 '15 at 21:31
  • ok solved that... open preferences... turn off, open last project (in case you had more than one going) then re-open smart svn. Then select 're-open existing working copy' and browse to the partially checked out folder. This will create a new project in your list, and then you can do a 'modify->cleanup' and 'update' – CthulhuJon Dec 01 '15 at 21:41
  • With some old clients, it doesn't work (1.6.16 for example). – Sandburg Oct 01 '19 at 11:54
33

From the Subversion documentation

If you interrupt a checkout (or something else interrupts your checkout, such as loss of connectivity, etc.), you can restart it either by issuing the identical checkout command again or by updating the incomplete working copy.

D Krueger
  • 2,446
  • 15
  • 12
  • 9
    They are the same, I think. This is from the Subversion mailing list: http://svn.haxx.se/users/archive-2005-04/1908.shtml where Ben Collins-Sussman states "There is no difference. Under the hood, they're the same code." – D Krueger Oct 27 '10 at 13:00
  • `svn cleanup` as mentioned in @Marc's answer might be necessary, but you're reference to the doc is more valuable! – Kalle Richter Jul 18 '14 at 08:53
  • 1
    can't do this.. it complains the folder is not empty – CthulhuJon Dec 01 '15 at 21:31
13
svn update

does the job for you.

zellus
  • 9,617
  • 5
  • 39
  • 56
  • 1
    If the initial `svn checkout` got far enough to create the project's directory and its `.svn` hidden repository information. Otherwise you will have to re-issue the `svn checkout` command again. – Jesse Chisholm Feb 01 '16 at 17:36
2

I also had same issue and finally thing which work for me is:- Step 1. In root folder right click on empty space and select "TortoiseSVN > Clean up..." then check all option in pop-up and run this Step 2. right click on empty space and click "SVN Update.."

It starts to resume now.

TonyG
  • 1,432
  • 12
  • 31
dplank
  • 91
  • 8
1

move into the copy directory

svn update    
svn cleanup
cd..

svn checkout download_path
seanwlk
  • 21
  • 6
1

The way I see it, there are three possibilities:

  • It does the checkout correctly and completely, without any headache for you. Problem solved.

  • It checks out everything that didn't get checked out last time. You do 'svn update' and you're golden.

  • It discovers that some stuff has been modified since having been checked out, complains, and aborts. You'll just have to remove the conflicting stuff.

In any event, any file that's been successfully checked out of the repository has associated metadata in your local tree and that will ensure that 'svn update' will get you the most recent version.

Eugene Smith
  • 9,126
  • 6
  • 36
  • 40
1

I had to checkout a big repository over an unreliable connection, so the co failed many times. Based on the answers here, I've ended up with a little loop, trying continuously the checkout (works with bash and other unix shells):

while ! svn co http://myserver/svn/myrepo/
do
    (cd myrepo; svn cleanup)
done

The same with some decoration if you want to know at the end how many retrials were needed:

i=0
while ! svn co http://myserver/svn/myrepo/
do
    i=$[i+1]
    (cd myrepo; svn cleanup)
done
echo $i

redseven
  • 849
  • 6
  • 11