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

Re: svn commit: r15678 - in trunk/subversion: clients/cmdline clients/cmdline/dtd libsvn_client

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2005-08-19 22:18:24 CEST

One backward compatibility remark:

On 8/11/05, sussman@tigris.org <sussman@tigris.org> wrote:
> Author: sussman
> Date: Thu Aug 11 09:02:04 2005
> New Revision: 15678
>
> Modified:
> trunk/subversion/clients/cmdline/dtd/list.dtd
> trunk/subversion/clients/cmdline/ls-cmd.c
> trunk/subversion/clients/cmdline/main.c
> trunk/subversion/include/svn_client.h
> trunk/subversion/libsvn_client/ls.c

>==============================================================================
> --- trunk/subversion/libsvn_client/ls.c (original)
> +++ trunk/subversion/libsvn_client/ls.c Thu Aug 11 09:02:04 2005
> @@ -23,6 +23,7 @@
> #include "client.h"
> #include "svn_client.h"
> #include "svn_path.h"
> +#include "svn_pools.h"
>
> #include "svn_private_config.h"
>
> @@ -71,7 +72,8 @@
> }
>
> svn_error_t *
> -svn_client_ls2 (apr_hash_t **dirents,
> +svn_client_ls3 (apr_hash_t **dirents,
> + apr_hash_t **locks,
> const char *path_or_url,
> const svn_opt_revision_t *peg_revision,
> const svn_opt_revision_t *revision,
> @@ -83,11 +85,21 @@
> svn_revnum_t rev;
> svn_node_kind_t url_kind;
> const char *url;
> + const char *repos_root;
> + const char *rel_path;
> + apr_pool_t *subpool;
> + apr_hash_t *new_locks;
> + apr_hash_index_t *hi;
>
> /* Get an RA plugin for this filesystem object. */
> SVN_ERR (svn_client__ra_session_from_path (&ra_session, &rev,
> &url, path_or_url, peg_revision,
> revision, ctx, pool));
> + /* Getting repository root. */
> + SVN_ERR (svn_ra_get_repos_root (ra_session, &repos_root, pool));
> +
> + /* Getting relative path respective to repository root. */
> + rel_path = svn_path_is_child (repos_root, url, pool);
>
> /* Decide if the URL is a file or directory. */
> SVN_ERR (svn_ra_check_path (ra_session, "", rev, &url_kind, pool));
> @@ -107,14 +119,14 @@
>
> /* Re-open the session to the file's parent instead. */
> svn_path_split (url, &parent_url, &base_name, pool);
> +
> /* 'base_name' is now the last component of an URL, but we want
> to use it as a plain file name. Therefore, we must URI-decode
> it. */
> base_name = svn_path_uri_decode(base_name, pool);
> SVN_ERR (svn_client__open_ra_session_internal (&ra_session, parent_url,
> - NULL,
> - NULL, NULL, FALSE, TRUE,
> - ctx, pool));
> + NULL, NULL, NULL, FALSE,
> + TRUE, ctx, pool));
>
> /* Get all parent's entries, no props. */
> SVN_ERR (svn_ra_get_dir (ra_session, "", rev, &parent_ents,
> @@ -127,6 +139,7 @@
> return svn_error_createf (SVN_ERR_FS_NOT_FOUND, NULL,
> _("URL '%s' non-existent in that revision"),
> url);
> + svn_path_split (rel_path, &rel_path, NULL, pool);
>
> apr_hash_set (*dirents, base_name, APR_HASH_KEY_STRING, the_ent);
> }
> @@ -135,8 +148,57 @@
> _("URL '%s' non-existent in that revision"),
> url);
>
> + if (locks == NULL)
> + return SVN_NO_ERROR;
> +
> + if (rel_path == NULL || rel_path[0] == 0)
> + rel_path = "/";
> + else
> + rel_path = apr_psprintf (pool, "/%s/", rel_path);
> +
> + subpool = svn_pool_create (pool);
> +
> + /* Get lock. */
> + SVN_ERR (svn_ra_get_locks (ra_session, locks, "", pool));

But what if the server doesn't support locks?

> +
> + new_locks = apr_hash_make (pool);
> + for (hi = apr_hash_first (pool, *locks); hi; hi = apr_hash_next (hi))
> + {
> + const void *key;
> + void *val;
> + const char *newkey;
> +
> + svn_pool_clear (subpool);
> +
> + apr_hash_this (hi, &key, NULL, &val);
> + newkey = svn_path_is_child (svn_path_canonicalize (rel_path, subpool),
> + svn_path_canonicalize (key, subpool),
> + pool);
> + if (newkey)
> + apr_hash_set (new_locks, newkey, APR_HASH_KEY_STRING, val);
> + }

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 19 22:19:34 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.