Author: stefan2
Date: Mon Jun 22 16:06:33 2015
New Revision: 1686888
URL: http://svn.apache.org/r1686888
Log:
Improve upon r1686478:
We only need to apply the path comparison hack for 'svn blame' in -g mode;
standard blame does the Right Thing even when mixing renames and changes.
Therefore, inform the hack when it needs to be applied and when not.
* subversion/libsvn_repos/rev_hunt.c
(send_baton): Add a flag for the -g mode.
(send_path_revision): Only apply the hack in -g mode.
(get_file_revs_backwards,
svn_repos_get_file_revs2): Initialize the new baton field.
* subversion/tests/libsvn_client/mtcc-test.c
(handle_rev): Adapt - reverting the r1686478 change here.
Modified:
subversion/trunk/subversion/libsvn_repos/rev_hunt.c
subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c
Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/rev_hunt.c?rev=1686888&r1=1686887&r2=1686888&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Mon Jun 22 16:06:33 2015
@@ -1336,6 +1336,7 @@ struct send_baton
apr_hash_t *last_props;
const char *last_path;
svn_fs_root_t *last_root;
+ svn_boolean_t include_merged_revisions;
};
/* Send PATH_REV to HANDLER and HANDLER_BATON, using information provided by
@@ -1379,10 +1380,11 @@ send_path_revision(struct path_revision
/* Special case: In the first revision, we always provide a delta. */
contents_changed = TRUE;
}
- else if (strcmp(sb->last_path, path_rev->path))
+ else if (sb->include_merged_revisions
+ && strcmp(sb->last_path, path_rev->path))
{
/* This is a HACK!!!
- * Blame, in older clients anyways, relies on getting a notification
+ * Blame -g, in older clients anyways, relies on getting a notification
* whenever the path changes - even if there was no content change.
*
* TODO: A future release should take an extra parameter and depending
@@ -1466,6 +1468,7 @@ get_file_revs_backwards(svn_repos_t *rep
last_pool = svn_pool_create(scratch_pool);
sb.iterpool = svn_pool_create(scratch_pool);
sb.last_pool = svn_pool_create(scratch_pool);
+ sb.include_merged_revisions = FALSE;
/* We want the first txdelta to be against the empty file. */
sb.last_root = NULL;
@@ -1621,6 +1624,9 @@ svn_repos_get_file_revs2(svn_repos_t *re
/* Create an empty hash table for the first property diff. */
sb.last_props = apr_hash_make(sb.last_pool);
+ /* Inform send_path_revision() whether workarounds / special behavior
+ * may be needed. */
+ sb.include_merged_revisions = include_merged_revisions;
/* Get the revisions we are interested in. */
duplicate_path_revs = apr_hash_make(scratch_pool);
Modified: subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c?rev=1686888&r1=1686887&r2=1686888&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c Mon Jun 22
16:06:33 2015
@@ -543,7 +543,8 @@ handle_rev(void *baton,
SVN_TEST_ASSERT(apr_hash_count(rev_props) >= 3);
SVN_TEST_STRING_ASSERT(path, (rev < 5) ? "/iota" : "/mu");
- if (!hrb->first && (rev == (hrb->up ? 8 : 6)))
+ if (!hrb->first
+ && (rev == (hrb->up ? 5 : 4) || rev == (hrb->up ? 8 : 6)))
SVN_TEST_ASSERT(delta_handler == NULL);
else
SVN_TEST_ASSERT(delta_handler != NULL);