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

Re: PATCH: issue 1361: Enable "svn cat -rBASE" to work without contacting the repository

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-09-22 19:06:03 CEST

Julian Foad <julianfoad@btopenworld.com> writes:

> Index: subversion/libsvn_client/cat.c
> ===================================================================
> --- subversion/libsvn_client/cat.c (revision 7111)
> +++ subversion/libsvn_client/cat.c (working copy)

> @@ -85,6 +133,27 @@
> /* Grab some properties we need to know in order to figure out if anything
> special needs to be done with this file. */
> SVN_ERR (ra_lib->get_file (session, "", rev, NULL, NULL, &props, pool));
> + }
> + else
> + {
> + /* Access the local text base */
> + const char *anchor, *target;
> + svn_node_kind_t kind;
> +
> + SVN_ERR (svn_wc_get_actual_target (path_or_url, &anchor, &target, pool));
> + SVN_ERR (svn_io_check_path (path_or_url, &kind, pool));
> + SVN_ERR (svn_wc_adm_open (&adm_access, NULL, anchor, FALSE,
> + FALSE, pool));
> +
> + if (kind == svn_node_dir)
> + return svn_error_createf(SVN_ERR_CLIENT_IS_DIRECTORY, NULL,
> + "Path \"%s\" refers to a directory",
> + path_or_url);

   $ rm versioned_file.c
   $ mkdir versioned_file.c
   $ svn cat -rBASE versioned_file.c

There is no reason for that to fail, the text-base is available.

svn_wc_get_actual_target is an expensive call. It might be better to
use the fact that 'svn cat PATH' requires PATH to be a file, so just
svn_path_split PATH, open the parent of PATH, get the svn_wc_entry_t
of PATH and check the entry is that of a file.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Sep 22 19:07:02 2003

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.