You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/04/10 19:55:31 UTC
svn commit: r1466596 - in /subversion/trunk/subversion: libsvn_client/cat.c
libsvn_subr/subst.c libsvn_wc/translate.c
Author: rhuijben
Date: Wed Apr 10 17:55:31 2013
New Revision: 1466596
URL: http://svn.apache.org/r1466596
Log:
Following up on r1466570, avoid doing unneeded work in a few common code paths.
* subversion/libsvn_client/cat.c
(svn_client__get_normalized_stream): Use svn_wc__node_get_repos_info to
obtain the url and the repository root.
* subversion/libsvn_subr/subst.c
(keyword_printf): Just check against the empty string (=normalized form)
instead of complete url check.
* subversion/libsvn_wc/translate.c
(svn_wc__expand_keywords): Don't fetch the repository root url when just
normalizing to the repository normal form.
Modified:
subversion/trunk/subversion/libsvn_client/cat.c
subversion/trunk/subversion/libsvn_subr/subst.c
subversion/trunk/subversion/libsvn_wc/translate.c
Modified: subversion/trunk/subversion/libsvn_client/cat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/cat.c?rev=1466596&r1=1466595&r2=1466596&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/cat.c (original)
+++ subversion/trunk/subversion/libsvn_client/cat.c Wed Apr 10 17:55:31 2013
@@ -125,15 +125,17 @@ svn_client__get_normalized_stream(svn_st
const char *url;
apr_time_t tm;
const char *repos_root_url;
+ const char *repos_relpath;
SVN_ERR(svn_wc__node_get_changed_info(&changed_rev, &tm, &author, wc_ctx,
local_abspath, scratch_pool,
scratch_pool));
- SVN_ERR(svn_wc__node_get_url(&url, wc_ctx, local_abspath, scratch_pool,
- scratch_pool));
- SVN_ERR(svn_wc__node_get_repos_info(NULL, NULL, &repos_root_url, NULL,
+ SVN_ERR(svn_wc__node_get_repos_info(NULL, &repos_relpath, &repos_root_url,
+ NULL,
wc_ctx, local_abspath, scratch_pool,
scratch_pool));
+ url = svn_path_url_add_component2(repos_root_url, repos_relpath,
+ scratch_pool);
if (local_mod)
{
Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1466596&r1=1466595&r2=1466596&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Wed Apr 10 17:55:31 2013
@@ -209,8 +209,7 @@ keyword_printf(const char *fmt,
svn_time_to_human_cstring(date, pool));
break;
case 'P': /* relative path of this file */
- if (repos_root_url && url &&
- svn_path_is_url(repos_root_url) && svn_path_is_url(url))
+ if (repos_root_url && *repos_root_url != '\0' && url && *url != '\0')
{
const char *repos_relpath;
@@ -220,7 +219,7 @@ keyword_printf(const char *fmt,
}
break;
case 'R': /* root of repos */
- if (repos_root_url && svn_path_is_url(repos_root_url))
+ if (repos_root_url && *repos_root_url != '\0')
svn_stringbuf_appendcstr(value, repos_root_url);
break;
case 'r': /* number of this revision */
Modified: subversion/trunk/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/translate.c?rev=1466596&r1=1466595&r2=1466596&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.c (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.c Wed Apr 10 17:55:31 2013
@@ -342,15 +342,7 @@ svn_wc__expand_keywords(apr_hash_t **key
changed_rev = SVN_INVALID_REVNUM;
changed_date = 0;
changed_author = "";
-
- SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL,
- &repos_root_url, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
+ repos_root_url = "";
}
SVN_ERR(svn_subst_build_keywords3(keywords, keyword_list,