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

Re: [PATCH] Fix for "svn log URL"

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-02-11 15:28:51 CET

David Summers <david@summersoft.fay.ar.us> writes:

> *** This is my first Subversion code patch so please go easy on me. :-)
>
> * ./subversion/libsvn_client/log.c : This patch fixes the problem where
> "svn log URL" wouldn't display the log; it seemed to be only checking
> to see if the path was a working copy.
> Now it does working copies, and URLS. However, it doesn't do a FILE
> PATH to a Subversion repository. Should it do that also?

If you mean 'svn log /some/path/repo/db', then probably not. In
general, svn commands act on URLs or working copy paths, there is no
reason for log to be different.

The log message should mention the function name, something like

* subversion/libsvn_client/log.c (svn_client_log): Add support for
  targets that are URLs.

and the HACKING file shows the style is to indent code inside braces

> + if (svn_path_is_url (&path_str))
> + {
> + URL = svn_stringbuf_dup (path_strbuf, pool);
> + }

but the method looks fine.

>
> Index: ./subversion/libsvn_client/log.c
> ===================================================================
> --- ./subversion/libsvn_client/log.c
> +++ ./subversion/libsvn_client/log.c Sat Feb 9 13:21:17 2002
> @@ -62,6 +62,8 @@
> svn_stringbuf_t *basename;
> apr_array_header_t *condensed_targets;
> svn_revnum_t start_revnum, end_revnum;
> + svn_string_t path_str;
> + svn_stringbuf_t *path_strbuf;
>
> if ((start->kind == svn_client_revision_unspecified)
> || (end->kind == svn_client_revision_unspecified))
> @@ -74,17 +76,28 @@
> SVN_ERR (svn_path_condense_targets (&basename, &condensed_targets,
> targets, pool));
>
> - /* Get full URL from the common path, carefully. */
> - SVN_ERR (svn_wc_entry (&entry, basename, pool));
> - if (! entry)
> - return svn_error_createf
> - (SVN_ERR_UNVERSIONED_RESOURCE, 0, NULL, pool,
> - "svn_client_log: %s is not under revision control", basename->data);
> - if (! entry->url)
> - return svn_error_createf
> - (SVN_ERR_ENTRY_MISSING_URL, 0, NULL, pool,
> - "svn_client_log: entry '%s' has no URL", basename->data);
> - URL = svn_stringbuf_dup (entry->url, pool);
> + path_strbuf = ((svn_stringbuf_t **) targets->elts)[0];
> + path_str.data = path_strbuf->data;
> + path_str.len = path_strbuf->len;
> +
> + if (svn_path_is_url (&path_str))
> + {
> + URL = svn_stringbuf_dup (path_strbuf, pool);
> + }
> + else
> + {
> + /* Get full URL from the common path, carefully. */
> + SVN_ERR (svn_wc_entry (&entry, basename, pool));
> + if (! entry)
> + return svn_error_createf
> + (SVN_ERR_UNVERSIONED_RESOURCE, 0, NULL, pool,
> + "svn_client_log: %s is not under revision control", basename->data);
> + if (! entry->url)
> + return svn_error_createf
> + (SVN_ERR_ENTRY_MISSING_URL, 0, NULL, pool,
> + "svn_client_log: entry '%s' has no URL", basename->data);
> + URL = svn_stringbuf_dup (entry->url, pool);
> + }
>
> /* Get the RA library that handles URL. */
> SVN_ERR (svn_ra_init_ra_libs (&ra_baton, pool));

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:06 2006

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.