Author: rhuijben
Date: Sun Feb 22 14:26:41 2015
New Revision: 1661479
URL: http://svn.apache.org/r1661479
Log:
Minor tweaks in the patch code to avoid a cast warning and to avoid a db query.
* subversion/libsvn_client/patch.c
(obtain_eol_and_keywords_for_file): Don't use two db queries when one
gives all the information needed.
(get_hunk_info): Use special linenumber type as argument to avoid warning.
(apply_one_patch): Use linenumber for local variable.
Modified:
subversion/trunk/subversion/libsvn_client/patch.c
Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1661479&r1=1661478&r2=1661479&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Sun Feb 22 14:26:41 2015
@@ -326,7 +326,8 @@ obtain_eol_and_keywords_for_file(apr_has
const char *rev_str;
const char *author;
const char *url;
- const char *root_url;
+ const char *repos_root_url;
+ const char *repos_relpath;
SVN_ERR(svn_wc__node_get_changed_info(&changed_rev,
&changed_date,
@@ -335,15 +336,17 @@ obtain_eol_and_keywords_for_file(apr_has
scratch_pool,
scratch_pool));
rev_str = apr_psprintf(scratch_pool, "%ld", changed_rev);
- 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, &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);
+
SVN_ERR(svn_subst_build_keywords3(keywords,
keywords_val->data,
- rev_str, url, root_url, changed_date,
+ rev_str, url, repos_root_url,
+ changed_date,
author, result_pool));
}
@@ -1592,7 +1595,7 @@ static svn_error_t *
get_hunk_info(hunk_info_t **hi, patch_target_t *target,
target_content_t *content,
svn_diff_hunk_t *hunk, svn_linenum_t fuzz,
- apr_int64_t previous_offset,
+ svn_linenum_t previous_offset,
svn_boolean_t ignore_whitespace,
svn_boolean_t is_prop_hunk,
svn_cancel_func_t cancel_func, void *cancel_baton,
@@ -2272,7 +2275,7 @@ apply_one_patch(patch_target_t **patch_t
int i;
static const svn_linenum_t MAX_FUZZ = 2;
apr_hash_index_t *hash_index;
- apr_int64_t previous_offset = 0;
+ svn_linenum_t previous_offset = 0;
SVN_ERR(init_patch_target(&target, patch, abs_wc_path, wc_ctx, strip_count,
remove_tempfiles, result_pool, scratch_pool));