Index: subversion/libsvn_ra_local/ra_plugin.c =================================================================== --- subversion/libsvn_ra_local/ra_plugin.c (revision 7614) +++ subversion/libsvn_ra_local/ra_plugin.c (working copy) @@ -131,6 +131,30 @@ /** The RA plugin routines **/ +/* Locking mechanism if requested */ +static svn_error_t * +svn_ra_local__lock (svn_ra_local__session_baton_t * session) +{ + /* TODO Add your locking mechanism here */ + /* Return an error code on failure */ + return SVN_NO_ERROR; +} + +/* Determine if this is a 'lock' URL, in which case we attempt */ +/* the lock and xlate the lock:// to a file:// on success */ +static svn_boolean_t +svn_ra_local__is_lock (svn_ra_local__session_baton_t * session, + const char * repos_URL) +{ + svn_boolean_t lock; + + lock=strncmp(repos_URL, "lock://", 7) == 0; + + if (lock) + strncpy ((char*)repos_URL, "file", 4); + + return lock; +} static svn_error_t * svn_ra_local__open (void **session_baton, @@ -147,6 +171,9 @@ session = apr_pcalloc (pool, sizeof(*session)); session->pool = pool; session->repository_URL = repos_URL; + + /* Save lock request */ + session->lock = svn_ra_local__is_lock (session,repos_URL); /* Look through the URL, figure out which part points to the repository, and which part is the path *within* the @@ -197,6 +224,11 @@ session->username = apr_pstrdup (pool, username_creds->username); } + /* Attempt the lock if requested, error out on failure */ + /* Attempt lock after authorization passed */ + if (session->lock) + SVN_ERR (svn_ra_local__lock(session)); + *session_baton = session; return SVN_NO_ERROR; } @@ -856,6 +888,9 @@ { apr_hash_set (hash, "file", APR_HASH_KEY_STRING, &ra_local_plugin); + /* lock protocol also triggers file protocol w/ additional feature */ + apr_hash_set (hash, "lock", APR_HASH_KEY_STRING, &ra_local_plugin); + /* ben sez: todo: check that abi_version >=1. */ return SVN_NO_ERROR; Index: subversion/libsvn_ra_local/ra_local.h =================================================================== --- subversion/libsvn_ra_local/ra_local.h (revision 7614) +++ subversion/libsvn_ra_local/ra_local.h (working copy) @@ -67,6 +67,7 @@ /* Callback stuff. */ const svn_ra_callbacks_t *callbacks; void *callback_baton; + svn_boolean_t lock; } svn_ra_local__session_baton_t;