msgbartop
Various ramblings-on, mostly about Red5
msgbarbottom

03 Sep 08 Fun with svnsync and googlecode

Today we (Red5) moved our cvsdude repository to our existing google code repository. One of the first steps to take care of is to remove anything in your google code repository and have it reset to revision 0. To get the reset, you have to post to the google code discussion group and request it. If your repository is already empty you may see the option to reset under your projects "Source" tab.

Before you start your sync I suggest that you perform an svn update, svn commit, and svn clean up on your source repository; in that order.

Step 1: Open a terminal or command window and issue this command from top level directory of your checkout location
svnsync init --username yourusername https://myproject.googlecode.com/svn/ https://svn1.cvsdude.com/myproject

The username is for your destination which is the first url specified, the next url is for the source. You may be presented with a password prompt and / or a key accept dialog, answer and proceed

Step 2: Issue the sync command, which will be used every time you need to restart the sync
svnsync sync https://myproject.googlecode.com/svn

The url should point to your destination.

If everything goes smoothly, you will not see any errors and your repository will exist on the destination. This was not the case for us, so here are the ways we got past the issues that resulted.

Errors that you may simply restart from:

svnsync: REPORT request failed on 'https://svn1.cvsdude.com/myproject'
svnsync: REPORT of 'https://svn1.cvsdude.com/myproject': 200 OK (https://svn1.cvsdude.com)


svnsync: PROPFIND request failed on '/svn/!svn/vcc/default'
svnsync: PROPFIND of '/svn/!svn/vcc/default': 502 Bad Gateway (https://myproject.googlecode.com)


svnsync: MERGE request failed on '/svn'
svnsync: MERGE of '/svn': 502 Bad Gateway (https://myproject.googlecode.com)


svnsync: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svnsync: At least one property change failed; repository is unchanged

Errors that require more a bit more work:


svnsync: Destination HEAD (99) is not the last merged revision (89); have you committed to the destination without using svnsync?

To fix this you should open your project in a browser and proceed to the "Source" tab and then select "Changes", note the latest revision and it should match the one displayed in the error which is 89 in this case. You will need to issue this command:


svn propset --revprop -r0 svn:sync-last-merged-rev 99 https://myproject.googlecode.com/svn

Some docs on the web say to use "revision" instead of "rev" but you can verify which one to use by issueing this command:

svn proplist --revprop -r 0 https://myproject.googlecode.com/svn

Which will output this:

Unversioned properties on revision 0:
svn:sync-from-uuid
svn:sync-last-merged-rev
svn:date
svn:sync-from-url

If another process locked up or is stuck in some way, you may see this error when issuing a command:

Failed to get lock on destination repos, currently held by 'COMPUTERNAME:e2e42f6b-6743-0241-9db7-0f85024665b6'

Kill any svnsync processes or cmd.exe processes to clear it.

If you seem to be caught in a loop where setting the revision doesn't let you continue, you should remove the currently-copying property like so:

svn pdel --revprop -r 0 svn:sync-currently-copying https://myproject.googlecode.com/svn

Use this with caution and only do it if you are sure that the revision that you are setting has been commited.


Another command that may be needed is "copy-revprops" which will manually copy a particular revision. Issue this command:

svnsync copy-revprops https://myproject.googlecode.com/svn 54

You may see this error which means you need to set the last merged revision

svnsync: Cannot copy revprops for a revision that has not been synchronized yet

If its successful you will see this message

Copied properties for revision 54.

New problem:
So I ran into another contdision that wasn't covered. Here what happened after a typical restart of the sync:


svnsync sync https://myproject.googlecode.com/svn/
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
svnsync: Couldn't get lock on destination repos after 10 attempts

So I issued this:

svn proplist --revprop -r 0 https://myproject.googlecode.com/svn

The response was:

Unversioned properties on revision 0:
svn:sync-from-uuid
svn:sync-lock
svn:sync-currently-copying
svn:sync-last-merged-rev
svn:date
svn:sync-from-url

So I deleted the lock and was able to continue with the sync

svn pdel --revprop -r 0 svn:sync-lock https://myproject.googlecode.com/svn property 'svn:sync-lock' deleted from repository revision 0

I hope you find this information useful, since I had to go around looking for it :)

Urls have changed to protect from any inadvertant modifications.


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , ,



Reader's Comments

  1. |

    View this Comment in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

  2. |

    Do you use svnmerge? Google runs a bit outdated svn version (http://code.google.com/support/bin/answer.py?answer=56665&topic=10386), but current svn 1.5 can do merges without external tools


    View this Comment in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish



Leave a Comment