You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/08/02 14:27:07 UTC
svn commit: r981483 - /subversion/trunk/subversion/libsvn_diff/diff_memory.c
Author: dannas
Date: Mon Aug 2 12:27:07 2010
New Revision: 981483
URL: http://svn.apache.org/viewvc?rev=981483&view=rev
Log:
Follow-up to r981462. Adjust the logic to handle the case when we're
dealing with the first hunk.
* subversion/libsvn_diff/diff_memory.c
(output_unified_diff_modified): Don't adjust the start of the original
lines if we're dealing with the first hunk.
Modified:
subversion/trunk/subversion/libsvn_diff/diff_memory.c
Modified: subversion/trunk/subversion/libsvn_diff/diff_memory.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/diff_memory.c?rev=981483&r1=981482&r2=981483&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/diff_memory.c (original)
+++ subversion/trunk/subversion/libsvn_diff/diff_memory.c Mon Aug 2 12:27:07 2010
@@ -519,9 +519,12 @@ output_unified_diff_modified(void *baton
targ_orig = (targ_orig < 0) ? 0 : targ_orig;
targ_mod = modified_start;
+ /* If the changed ranges are far enough apart (no overlapping or
+ * connecting context), flush the current hunk. */
if (btn->next_token + SVN_DIFF__UNIFIED_CONTEXT_SIZE < targ_orig)
SVN_ERR(output_unified_flush_hunk(btn, btn->hunk_delimiter));
- else
+ /* Adjust offset if it's not the first hunk. */
+ else if (btn->hunk_length[0] != 0)
targ_orig = btn->next_token;
if (btn->hunk_length[0] == 0