Author: julianfoad
Date: Fri May 31 19:26:05 2013
New Revision: 1488360
URL: http://svn.apache.org/r1488360
Log:
* subversion/libsvn_repos/reporter.c
(delta_dirs): Move variables into tighter scope, declaring them separately
in each scope where they are used instead of sharing them.
Modified:
subversion/trunk/subversion/libsvn_repos/reporter.c
Modified: subversion/trunk/subversion/libsvn_repos/reporter.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/reporter.c?rev=1488360&r1=1488359&r2=1488360&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/reporter.c (original)
+++ subversion/trunk/subversion/libsvn_repos/reporter.c Fri May 31 19:26:05 2013
@@ -1140,12 +1140,9 @@ delta_dirs(report_baton_t *b, svn_revnum
svn_boolean_t start_empty, svn_depth_t wc_depth,
svn_depth_t requested_depth, apr_pool_t *pool)
{
- svn_fs_root_t *s_root;
apr_hash_t *s_entries = NULL, *t_entries;
apr_hash_index_t *hi;
apr_pool_t *subpool;
- const char *name, *s_fullpath, *t_fullpath, *e_fullpath;
- path_info_t *info;
/* Compare the property lists. If we're starting empty, pass a NULL
source path so that we add all the properties.
@@ -1160,6 +1157,8 @@ delta_dirs(report_baton_t *b, svn_revnum
/* Get the list of entries in each of source and target. */
if (s_path && !start_empty)
{
+ svn_fs_root_t *s_root;
+
SVN_ERR(get_source_root(b, &s_root, s_rev));
SVN_ERR(svn_fs_dir_entries(&s_entries, s_root, s_path, pool));
}
@@ -1170,6 +1169,8 @@ delta_dirs(report_baton_t *b, svn_revnum
while (1)
{
+ path_info_t *info;
+ const char *name, *s_fullpath, *t_fullpath, *e_fullpath;
const svn_fs_dirent_t *s_entry, *t_entry;
svn_pool_clear(subpool);
@@ -1197,8 +1198,7 @@ delta_dirs(report_baton_t *b, svn_revnum
t_fullpath = svn_fspath__join(t_path, name, subpool);
t_entry = svn_hash_gets(t_entries, name);
s_fullpath = s_path ? svn_fspath__join(s_path, name, subpool) : NULL;
- s_entry = s_entries ?
- svn_hash_gets(s_entries, name) : NULL;
+ s_entry = s_entries ? svn_hash_gets(s_entries, name) : NULL;
/* The only special cases here are
@@ -1240,13 +1240,13 @@ delta_dirs(report_baton_t *b, svn_revnum
hi;
hi = apr_hash_next(hi))
{
- const svn_fs_dirent_t *s_entry;
+ const svn_fs_dirent_t *s_entry = svn__apr_hash_index_val(hi);
svn_pool_clear(subpool);
- s_entry = svn__apr_hash_index_val(hi);
if (svn_hash_gets(t_entries, s_entry->name) == NULL)
{
+ const char *e_fullpath;
svn_revnum_t deleted_rev;
if (s_entry->kind == svn_node_file
@@ -1277,10 +1277,11 @@ delta_dirs(report_baton_t *b, svn_revnum
/* Loop over the dirents in the target. */
for (hi = apr_hash_first(pool, t_entries); hi; hi = apr_hash_next(hi))
{
- const svn_fs_dirent_t *s_entry, *t_entry;
+ const svn_fs_dirent_t *t_entry = svn__apr_hash_index_val(hi);
+ const svn_fs_dirent_t *s_entry;
+ const char *s_fullpath, *t_fullpath, *e_fullpath;
svn_pool_clear(subpool);
- t_entry = svn__apr_hash_index_val(hi);
if (is_depth_upgrade(wc_depth, requested_depth, t_entry->kind))
{
@@ -1301,11 +1302,9 @@ delta_dirs(report_baton_t *b, svn_revnum
|| requested_depth == svn_depth_files))
continue;
- /* Look for an entry with the same name
- in the source dirents. */
+ /* Look for an entry with the same name in the source dirents. */
s_entry = s_entries ?
- svn_hash_gets(s_entries, t_entry->name)
- : NULL;
+ svn_hash_gets(s_entries, t_entry->name) : NULL;
s_fullpath = s_entry ?
svn_fspath__join(s_path, t_entry->name, subpool) : NULL;
}
@@ -1321,8 +1320,6 @@ delta_dirs(report_baton_t *b, svn_revnum
subpool));
}
-
- /* Destroy iteration subpool. */
svn_pool_destroy(subpool);
}
return SVN_NO_ERROR;