Author: stsp Date: Tue Apr 10 17:34:08 2012 New Revision: 1311879 URL: http://svn.apache.org/viewvc?rev=1311879&view=rev Log: * subversion/libsvn_client/diff.c (arbitrary_diff_walker): Improve docstring. Move code to initialise the CHILD_RELPATH down a bit so that initialisation happens closer to usage.
Modified: subversion/trunk/subversion/libsvn_client/diff.c Modified: subversion/trunk/subversion/libsvn_client/diff.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1311879&r1=1311878&r2=1311879&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/diff.c (original) +++ subversion/trunk/subversion/libsvn_client/diff.c Tue Apr 10 17:34:08 2012 @@ -2007,7 +2007,9 @@ do_arbitrary_dirs_diff(const char *local return SVN_NO_ERROR; } -/* An implementation of svn_io_walk_func_t. */ +/* An implementation of svn_io_walk_func_t. + * Note: LOCAL_ABSPATH is the path being crawled and can be on either side + * of the diff depending on baton->recursing_within_added_subtree. */ static svn_error_t * arbitrary_diff_walker(void *baton, const char *local_abspath, const apr_finfo_t *finfo, @@ -2032,13 +2034,6 @@ arbitrary_diff_walker(void *baton, const if (finfo->filetype != APR_DIR) return SVN_NO_ERROR; - if (b->recursing_within_added_subtree) - child_relpath = svn_dirent_skip_ancestor(b->root2_abspath, local_abspath); - else - child_relpath = svn_dirent_skip_ancestor(b->root1_abspath, local_abspath); - if (!child_relpath) - return SVN_NO_ERROR; - if (b->recursing_within_adm_dir) { if (svn_dirent_skip_ancestor(b->adm_dir_abspath, local_abspath)) @@ -2057,6 +2052,13 @@ arbitrary_diff_walker(void *baton, const return SVN_NO_ERROR; } + if (b->recursing_within_added_subtree) + child_relpath = svn_dirent_skip_ancestor(b->root2_abspath, local_abspath); + else + child_relpath = svn_dirent_skip_ancestor(b->root1_abspath, local_abspath); + if (!child_relpath) + return SVN_NO_ERROR; + local_abspath1 = svn_dirent_join(b->root1_abspath, child_relpath, scratch_pool); SVN_ERR(svn_io_check_resolved_path(local_abspath1, &kind1, scratch_pool));