diff options
Diffstat (limited to 'subversion/libsvn_ra_serf/getlocks.c')
| -rw-r--r-- | subversion/libsvn_ra_serf/getlocks.c | 19 | 
1 files changed, 17 insertions, 2 deletions
| diff --git a/subversion/libsvn_ra_serf/getlocks.c b/subversion/libsvn_ra_serf/getlocks.c index 04e556179936..df201a7506f5 100644 --- a/subversion/libsvn_ra_serf/getlocks.c +++ b/subversion/libsvn_ra_serf/getlocks.c @@ -116,6 +116,7 @@ getlocks_closed(svn_ra_serf__xml_estate_t *xes,    if (leaving_state == LOCK)      {        const char *path = svn_hash_gets(attrs, "path"); +      const char *token = svn_hash_gets(attrs, "token");        svn_boolean_t save_lock = FALSE;        /* Filter out unwanted paths.  Since Subversion only allows @@ -128,6 +129,12 @@ getlocks_closed(svn_ra_serf__xml_estate_t *xes,           c) we've asked for depth=files or depth=immediates, and this              lock is on an immediate child of our query path.        */ +      if (! token) +        { +          /* A lock without a token is not a lock; just an answer that there +             is no lock on the node. */ +          save_lock = FALSE; +        }        if (strcmp(lock_ctx->path, path) == 0            || lock_ctx->requested_depth == svn_depth_infinity)          { @@ -154,7 +161,7 @@ getlocks_closed(svn_ra_serf__xml_estate_t *xes,               them may have not been sent, so the value will be NULL.  */            lock.path = path; -          lock.token = svn_hash_gets(attrs, "token"); +          lock.token = token;            lock.owner = svn_hash_gets(attrs, "owner");            lock.comment = svn_hash_gets(attrs, "comment"); @@ -234,6 +241,7 @@ svn_ra_serf__get_locks(svn_ra_session_t *ra_session,    svn_ra_serf__handler_t *handler;    svn_ra_serf__xml_context_t *xmlctx;    const char *req_url, *rel_path; +  svn_error_t *err;    req_url = svn_path_url_add_component2(session->session_url.path, path, pool);    SVN_ERR(svn_ra_serf__get_relative_path(&rel_path, req_url, session, @@ -260,7 +268,14 @@ svn_ra_serf__get_locks(svn_ra_session_t *ra_session,    handler->body_delegate = create_getlocks_body;    handler->body_delegate_baton = lock_ctx; -  SVN_ERR(svn_ra_serf__context_run_one(handler, pool)); +  err = svn_ra_serf__context_run_one(handler, pool); +   +  /* Wrap the server generated error for an unsupported report with the +     documented error for this ra function. */ +  if (svn_error_find_cause(err, SVN_ERR_UNSUPPORTED_FEATURE)) +    err = svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL); +     +  SVN_ERR(err);    /* We get a 404 when a path doesn't exist in HEAD, but it might       have existed earlier (E.g. 'svn ls http://s/svn/trunk/file@1' */ | 
