[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Check UUID at RA connection opening

From: Daniel Shahaf <d.s_at_daniel.shahaf.co.il>
Date: Mon, 24 Mar 2008 22:06:41 +0200

Currently, the repository's uuid is not always checked when creating an RA
connection. This results in 'svn update' overwriting the working copy's
uuid with the repository's new uuid, when the latter has changed.

Following discussion on IRC a few weeks ago, a check for uuid equality is
added in svn_ra_open2(), which is revved to take a const char *uuid
argument. (durin42 also volunteered to write the patch, but I understood
from him that he was busy and didn't mind that I do it if I had time.)

Two places in the code already validate the uuid by themselves:
open_source_session() in svnsync, and validator_func() in
libsvn_client/relocate.c (which is an svn_wc_relocation_validator3_t).
I have not modified them.

[[[
Check repository UUID when creating an RA session. This fixes an issue
where "svn update" would silently overwrite the UUID of a working copy
if the repository UUID has changed.

Several tests in svnadmin_tests which silently took advantage of this
are fixed too.

* subversion/include/svn_ra.h
   (svn_ra_open2, svn_ra_open3): New API revision.

* subversion/libsvn_ra/ra_loader.c
   (svn_ra_open2, svn_ra_open3): New API revision.

* subversion/libsvn_client/ra.c
   (svn_client__open_ra_session_internal):
     When having a working copy, pass its uuid to svn_ra_open3().

* subversion/tests/cmdline/update_tests.py
   (update_uuid_changed): New test.
   (test_list): Run it.

* subversion/tests/cmdline/svnadmin_tests.py
   (extra_headers, extra_blockcontent, empty_date):
     Load dumpfile with '--ignore-uuid' in order to not change the repository
     uuid, since a working copy already has been checked out from it.

* subversion/tests/cmdline/switch_tests.py
   (switch_change_repos_root): Change expected error message.

* subversion/include/svn_error_codes.h
   (SVN_ERR_RA_UUID_MISMATCH): New error.
]]]

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-03-24 21:07:50 CET

This is an archived mail posted to the Subversion Dev mailing list.