You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2018/11/07 20:02:58 UTC
svn commit: r1846071 - in /subversion/branches/ra-git/subversion:
libsvn_fs_git/git-history.c libsvn_fs_git/util.c
tests/libsvn_client/git-client-test.c
Author: brane
Date: Wed Nov 7 20:02:58 2018
New Revision: 1846071
URL: http://svn.apache.org/viewvc?rev=1846071&view=rev
Log:
On the ra-git branch: Fix C90 violations and some warnings.
* subversion/libsvn_fs_git/git-history.c
(fs_git_node_history_prev): Fix declaration-after-statement errors.
* subversion/libsvn_fs_git/util.c
(svn_fs_git__get_blob_stream): Fix declaration-after-statement error.
* subversion/tests/libsvn_client/git-client-test.c
(ls_recursive): Use svn_client_list4 (fixes deprecation warning).
(test_git_mkdir): Convert C++-style comment block to preprocessor exclusion.
Modified:
subversion/branches/ra-git/subversion/libsvn_fs_git/git-history.c
subversion/branches/ra-git/subversion/libsvn_fs_git/util.c
subversion/branches/ra-git/subversion/tests/libsvn_client/git-client-test.c
Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/git-history.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/git-history.c?rev=1846071&r1=1846070&r2=1846071&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_git/git-history.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/git-history.c Wed Nov 7 20:02:58 2018
@@ -265,6 +265,9 @@ fs_git_node_history_prev(svn_fs_history_
fs_git_node_history_t *gnh;
apr_pool_t *cur_pool = svn_pool_create(result_pool);
apr_pool_t *last_pool = svn_pool_create(result_pool);
+ const git_commit *commit;
+ const git_tree_entry *entry;
+ const char *relpath;
/* ### cross_copies is still unused! */
@@ -274,9 +277,8 @@ fs_git_node_history_prev(svn_fs_history_
return SVN_NO_ERROR;
}
- const git_commit *commit = p_gnh->commit;
- const git_tree_entry *entry;
- const char *relpath = p_gnh->relpath;
+ commit = p_gnh->commit;
+ relpath = p_gnh->relpath;
if (!p_gnh->first)
SVN_ERR(svn_git__commit_parent(&commit, commit, 0, last_pool));
Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/util.c?rev=1846071&r1=1846070&r2=1846071&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_fs_git/util.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/util.c Wed Nov 7 20:02:58 2018
@@ -127,6 +127,7 @@ svn_fs_git__get_blob_stream(svn_stream_t
{
git_odb_object *ob;
apr_pool_t *subpool;
+ apr_size_t size;
char *data;
#if 0
@@ -145,15 +146,15 @@ svn_fs_git__get_blob_stream(svn_stream_t
subpool = svn_pool_create(result_pool);
- apr_size_t sz = git_odb_object_size(ob);
- data = apr_pmemdup(subpool, git_odb_object_data(ob), sz);
+ size = git_odb_object_size(ob);
+ data = apr_pmemdup(subpool, git_odb_object_data(ob), size);
git_odb_object_free(ob);
blob_stream = apr_pcalloc(result_pool, sizeof(*blob_stream));
blob_stream->cleanup_pool = subpool;
blob_stream->data = data;
- blob_stream->data_left = sz;
+ blob_stream->data_left = size;
git_odb_free(odb);
odb = NULL;
Modified: subversion/branches/ra-git/subversion/tests/libsvn_client/git-client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/libsvn_client/git-client-test.c?rev=1846071&r1=1846070&r2=1846071&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/tests/libsvn_client/git-client-test.c (original)
+++ subversion/branches/ra-git/subversion/tests/libsvn_client/git-client-test.c Wed Nov 7 20:02:58 2018
@@ -156,8 +156,8 @@ ls_recursive(apr_hash_t **entries,
apr_hash_t *result = apr_hash_make(result_pool);
head.kind = svn_opt_revision_head;
- SVN_ERR(svn_client_list3(url_or_abspath, &head, &head,
- svn_depth_infinity,
+ SVN_ERR(svn_client_list4(url_or_abspath, &head, &head,
+ NULL, svn_depth_infinity,
SVN_DIRENT_KIND, FALSE, FALSE,
ls_collect_names, result,
ctx, scratch_pool));
@@ -186,21 +186,21 @@ test_git_mkdir(const svn_test_opts_t *op
SVN_ERR(svn_client_create_context2(&ctx, NULL, pool));
trunk_url = svn_path_url_add_component2(repos_url, "trunk", pool);
- //head_rev.kind = svn_opt_revision_head;
- //SVN_ERR(svn_client_checkout3(&rev, trunk_url,
- // wc_dir, &head_rev, &head_rev, svn_depth_infinity,
- // FALSE, FALSE, ctx, pool));
- //
- //
- //{
- // apr_array_header_t *revs;
- // apr_array_header_t *paths = apr_array_make(pool, 1, sizeof(const char *));
- // APR_ARRAY_PUSH(paths, const char *) = wc_dir;
- //
- // SVN_ERR(svn_client_update4(&revs, paths, &head_rev, svn_depth_infinity, FALSE,
- // FALSE, FALSE, FALSE, FALSE, ctx, pool));
- //}
-
+#if 0
+ head_rev.kind = svn_opt_revision_head;
+ SVN_ERR(svn_client_checkout3(&rev, trunk_url,
+ wc_dir, &head_rev, &head_rev, svn_depth_infinity,
+ FALSE, FALSE, ctx, pool));
+
+ {
+ apr_array_header_t *revs;
+ apr_array_header_t *paths = apr_array_make(pool, 1, sizeof(const char *));
+ APR_ARRAY_PUSH(paths, const char *) = wc_dir;
+
+ SVN_ERR(svn_client_update4(&revs, paths, &head_rev, svn_depth_infinity, FALSE,
+ FALSE, FALSE, FALSE, FALSE, ctx, pool));
+ }
+#endif
SVN_ERR(svn_client__mtcc_create(&mtcc, repos_url, 0, ctx, subpool, subpool));
SVN_ERR(svn_client__mtcc_add_mkdir("trunk", mtcc, subpool));