You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/08/27 14:11:37 UTC

svn commit: r990121 - in /subversion/trunk/subversion: bindings/swig/svn_diff.i include/svn_diff.h libsvn_client/patch.c libsvn_diff/parse-diff.c tests/libsvn_diff/parse-diff-test.c

Author: julianfoad
Date: Fri Aug 27 12:11:37 2010
New Revision: 990121

URL: http://svn.apache.org/viewvc?rev=990121&view=rev
Log:
Rename 'svn_hunk_t' to 'svn_diff_hunk_t', in order to keep a common
'svn_diff_' prefix on diff library symbols.

* subversion/include/svn_diff.h,
  subversion/libsvn_diff/parse-diff.c
  (svn_hunk_t): Rename to 'svn_diff_hunk_t'. Update all references.

* subversion/libsvn_client/patch.c,
  subversion/tests/libsvn_diff/parse-diff-test.c,
  subversion/bindings/swig/svn_diff.i
    Update all references.

Modified:
    subversion/trunk/subversion/bindings/swig/svn_diff.i
    subversion/trunk/subversion/include/svn_diff.h
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/libsvn_diff/parse-diff.c
    subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c

Modified: subversion/trunk/subversion/bindings/swig/svn_diff.i
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/svn_diff.i?rev=990121&r1=990120&r2=990121&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/svn_diff.i (original)
+++ subversion/trunk/subversion/bindings/swig/svn_diff.i Fri Aug 27 12:11:37 2010
@@ -48,9 +48,9 @@
 
 /* The WRAPPED_STREAM typemap can't cope with struct members, and there
    isn't really a reason to change these. */
-%immutable svn_hunk_t::diff_text;
-%immutable svn_hunk_t::original_text;
-%immutable svn_hunk_t::modified_text;
+%immutable svn_diff_hunk_t::diff_text;
+%immutable svn_diff_hunk_t::original_text;
+%immutable svn_diff_hunk_t::modified_text;
 
 /* Ditto. */
 %immutable svn_patch_t::patch_file;

Modified: subversion/trunk/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_diff.h?rev=990121&r1=990120&r2=990121&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_diff.h (original)
+++ subversion/trunk/subversion/include/svn_diff.h Fri Aug 27 12:11:37 2010
@@ -826,7 +826,7 @@ typedef enum svn_diff_operation_kind_e
  * @see svn_diff_hunk_readline_modified_text()
  *
  * @since New in 1.7. */
-typedef struct svn_hunk_t svn_hunk_t;
+typedef struct svn_diff_hunk_t svn_diff_hunk_t;
 
 /**
  * Allocate @a *stringbuf in @a result_pool, and read into it one line
@@ -844,7 +844,7 @@ typedef struct svn_hunk_t svn_hunk_t;
  * @since New in 1.7.
  */
 svn_error_t *
-svn_diff_hunk_readline_diff_text(const svn_hunk_t *hunk,
+svn_diff_hunk_readline_diff_text(const svn_diff_hunk_t *hunk,
                                  svn_stringbuf_t **stringbuf,
                                  const char **eol,
                                  svn_boolean_t *eof,
@@ -860,11 +860,11 @@ svn_diff_hunk_readline_diff_text(const s
  * and @a eol is not NULL, @a *eol is set to NULL.
  * Temporary allocations will be performed in @a scratch_pool.
  *
- * @see svn_hunk_t
+ * @see svn_diff_hunk_t
  * @since New in 1.7.
  */
 svn_error_t *
-svn_diff_hunk_readline_original_text(const svn_hunk_t *hunk,
+svn_diff_hunk_readline_original_text(const svn_diff_hunk_t *hunk,
                                      svn_stringbuf_t **stringbuf,
                                      const char **eol,
                                      svn_boolean_t *eof,
@@ -875,11 +875,11 @@ svn_diff_hunk_readline_original_text(con
  * Like svn_diff_hunk_readline_original_text(), but it returns lines from
  * the modified text of the hunk.
  *
- * @see svn_hunk_t
+ * @see svn_diff_hunk_t
  * @since New in 1.7.
  */
 svn_error_t *
-svn_diff_hunk_readline_modified_text(const svn_hunk_t *hunk,
+svn_diff_hunk_readline_modified_text(const svn_diff_hunk_t *hunk,
                                      svn_stringbuf_t **stringbuf,
                                      const char **eol,
                                      svn_boolean_t *eof,
@@ -889,55 +889,55 @@ svn_diff_hunk_readline_modified_text(con
 /** Reset the diff text of @a hunk so it can be read again from the start.
  * @since New in 1.7. */
 svn_error_t *
-svn_diff_hunk_reset_diff_text(const svn_hunk_t *hunk);
+svn_diff_hunk_reset_diff_text(const svn_diff_hunk_t *hunk);
 
 /** Reset the original text of @a hunk so it can be read again from the start.
  * @since New in 1.7. */
 svn_error_t *
-svn_diff_hunk_reset_original_text(const svn_hunk_t *hunk);
+svn_diff_hunk_reset_original_text(const svn_diff_hunk_t *hunk);
 
 /** Reset the modified text of @a hunk so it can be read again from the start.
  * @since New in 1.7. */
 svn_error_t *
-svn_diff_hunk_reset_modified_text(const svn_hunk_t *hunk);
+svn_diff_hunk_reset_modified_text(const svn_diff_hunk_t *hunk);
 
 /** Return the line offset of the original hunk text,
  * as parsed from the hunk header.
  * @since New in 1.7. */
 svn_linenum_t
-svn_diff_hunk_get_original_start(const svn_hunk_t *hunk);
+svn_diff_hunk_get_original_start(const svn_diff_hunk_t *hunk);
 
 /** Return the number of lines in the original @a hunk text,
  * as parsed from the hunk header.
  * @since New in 1.7. */
 svn_linenum_t
-svn_diff_hunk_get_original_length(const svn_hunk_t *hunk);
+svn_diff_hunk_get_original_length(const svn_diff_hunk_t *hunk);
 
 /** Return the line offset of the modified @a hunk text,
  * as parsed from the hunk header.
  * @since New in 1.7. */
 svn_linenum_t
-svn_diff_hunk_get_modified_start(const svn_hunk_t *hunk);
+svn_diff_hunk_get_modified_start(const svn_diff_hunk_t *hunk);
 
 /** Return the number of lines in the modified @a hunk text,
  * as parsed from the hunk header.
  * @since New in 1.7. */
 svn_linenum_t
-svn_diff_hunk_get_modified_length(const svn_hunk_t *hunk);
+svn_diff_hunk_get_modified_length(const svn_diff_hunk_t *hunk);
 
 /** Return the number of lines of leading context of @a hunk,
  * i.e. the number of lines starting with ' ' before the first line
  * that starts with a '+' or '-'.
  * @since New in 1.7. */
 svn_linenum_t
-svn_diff_hunk_get_leading_context(const svn_hunk_t *hunk);
+svn_diff_hunk_get_leading_context(const svn_diff_hunk_t *hunk);
 
 /** Return the number of lines of trailing context of @a hunk,
  * i.e. the number of lines starting with ' ' after the last line
  * that starts with a '+' or '-'.
  * @since New in 1.7. */
 svn_linenum_t
-svn_diff_hunk_get_trailing_context(const svn_hunk_t *hunk);
+svn_diff_hunk_get_trailing_context(const svn_diff_hunk_t *hunk);
 
 /**
  * Data type to manage parsing of properties in patches.
@@ -950,8 +950,8 @@ typedef struct svn_prop_patch_t {
   svn_diff_operation_kind_t operation;
 
   /**
-   * An array containing an svn_hunk_t object for each hunk parsed from the
-   * patch associated with our property name */
+   * An array containing an svn_diff_hunk_t object for each hunk parsed
+   * from the patch associated with our property name */
   apr_array_header_t *hunks;
 } svn_prop_patch_t;
 
@@ -974,7 +974,7 @@ typedef struct svn_patch_t {
   const char *new_filename;
 
   /**
-   * An array containing an svn_hunk_t object for each hunk parsed
+   * An array containing an svn_diff_hunk_t object for each hunk parsed
    * from the patch. */
   apr_array_header_t *hunks;
 

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=990121&r1=990120&r2=990121&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Fri Aug 27 12:11:37 2010
@@ -48,7 +48,7 @@
 
 typedef struct hunk_info_t {
   /* The hunk. */
-  const svn_hunk_t *hunk;
+  const svn_diff_hunk_t *hunk;
 
   /* The line where the hunk matched in the target file. */
   svn_linenum_t matched_line;
@@ -792,7 +792,7 @@ seek_to_line(target_content_info_t *cont
  * Do temporary allocations in POOL. */
 static svn_error_t *
 match_hunk(svn_boolean_t *matched, target_content_info_t *content_info,
-           const svn_hunk_t *hunk, int fuzz, 
+           const svn_diff_hunk_t *hunk, int fuzz,
            svn_boolean_t ignore_whitespace,
            svn_boolean_t match_modified, apr_pool_t *pool)
 {
@@ -921,7 +921,7 @@ match_hunk(svn_boolean_t *matched, targe
 static svn_error_t *
 scan_for_match(svn_linenum_t *matched_line, 
                target_content_info_t *content_info,
-               const svn_hunk_t *hunk, svn_boolean_t match_first,
+               const svn_diff_hunk_t *hunk, svn_boolean_t match_first,
                svn_linenum_t upper_line, int fuzz, 
                svn_boolean_t ignore_whitespace,
                svn_boolean_t match_modified,
@@ -993,7 +993,7 @@ scan_for_match(svn_linenum_t *matched_li
 static svn_error_t *
 match_existing_target(svn_boolean_t *match,
                       target_content_info_t *content_info,
-                      const svn_hunk_t *hunk,
+                      const svn_diff_hunk_t *hunk,
                       svn_stream_t *stream,
                       apr_pool_t *scratch_pool)
 {
@@ -1058,7 +1058,7 @@ match_existing_target(svn_boolean_t *mat
 static svn_error_t *
 get_hunk_info(hunk_info_t **hi, patch_target_t *target,
               target_content_info_t *content_info,
-              const svn_hunk_t *hunk, int fuzz, 
+              const svn_diff_hunk_t *hunk, int fuzz,
               svn_boolean_t ignore_whitespace,
               svn_boolean_t is_prop_hunk,
               svn_cancel_func_t cancel_func, void *cancel_baton,
@@ -1649,7 +1649,7 @@ apply_one_patch(patch_target_t **patch_t
   /* Match hunks. */
   for (i = 0; i < patch->hunks->nelts; i++)
     {
-      svn_hunk_t *hunk;
+      svn_diff_hunk_t *hunk;
       hunk_info_t *hi;
       int fuzz = 0;
 
@@ -1658,7 +1658,7 @@ apply_one_patch(patch_target_t **patch_t
       if (cancel_func)
         SVN_ERR((cancel_func)(cancel_baton));
 
-      hunk = APR_ARRAY_IDX(patch->hunks, i, svn_hunk_t *);
+      hunk = APR_ARRAY_IDX(patch->hunks, i, svn_diff_hunk_t *);
 
       /* Determine the line the hunk should be applied at.
        * If no match is found initially, try with fuzz. */
@@ -1730,7 +1730,7 @@ apply_one_patch(patch_target_t **patch_t
 
       for (i = 0; i < prop_patch->hunks->nelts; i++)
         {
-          svn_hunk_t *hunk;
+          svn_diff_hunk_t *hunk;
           hunk_info_t *hi;
           int fuzz = 0;
 
@@ -1739,7 +1739,7 @@ apply_one_patch(patch_target_t **patch_t
           if (cancel_func)
             SVN_ERR((cancel_func)(cancel_baton));
 
-          hunk = APR_ARRAY_IDX(prop_patch->hunks, i, svn_hunk_t *);
+          hunk = APR_ARRAY_IDX(prop_patch->hunks, i, svn_diff_hunk_t *);
 
           /* Determine the line the hunk should be applied at.
            * If no match is found initially, try with fuzz. */

Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=990121&r1=990120&r2=990121&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Fri Aug 27 12:11:37 2010
@@ -38,7 +38,7 @@
 #define starts_with(str, start)  \
   (strncmp((str), (start), strlen(start)) == 0)
 
-struct svn_hunk_t {
+struct svn_diff_hunk_t {
   /* Hunk texts (see include/svn_diff.h). */
   svn_stream_t *diff_text;
   svn_stream_t *original_text;
@@ -60,55 +60,55 @@ struct svn_hunk_t {
 };
 
 svn_error_t *
-svn_diff_hunk_reset_diff_text(const svn_hunk_t *hunk)
+svn_diff_hunk_reset_diff_text(const svn_diff_hunk_t *hunk)
 {
   return svn_error_return(svn_stream_reset(hunk->diff_text));
 }
 
 svn_error_t *
-svn_diff_hunk_reset_original_text(const svn_hunk_t *hunk)
+svn_diff_hunk_reset_original_text(const svn_diff_hunk_t *hunk)
 {
   return svn_error_return(svn_stream_reset(hunk->original_text));
 }
 
 svn_error_t *
-svn_diff_hunk_reset_modified_text(const svn_hunk_t *hunk)
+svn_diff_hunk_reset_modified_text(const svn_diff_hunk_t *hunk)
 {
   return svn_error_return(svn_stream_reset(hunk->modified_text));
 }
 
 svn_linenum_t
-svn_diff_hunk_get_original_start(const svn_hunk_t *hunk)
+svn_diff_hunk_get_original_start(const svn_diff_hunk_t *hunk)
 {
   return hunk->original_start;
 }
 
 svn_linenum_t
-svn_diff_hunk_get_original_length(const svn_hunk_t *hunk)
+svn_diff_hunk_get_original_length(const svn_diff_hunk_t *hunk)
 {
   return hunk->original_length;
 }
 
 svn_linenum_t
-svn_diff_hunk_get_modified_start(const svn_hunk_t *hunk)
+svn_diff_hunk_get_modified_start(const svn_diff_hunk_t *hunk)
 {
   return hunk->modified_start;
 }
 
 svn_linenum_t
-svn_diff_hunk_get_modified_length(const svn_hunk_t *hunk)
+svn_diff_hunk_get_modified_length(const svn_diff_hunk_t *hunk)
 {
   return hunk->modified_length;
 }
 
 svn_linenum_t
-svn_diff_hunk_get_leading_context(const svn_hunk_t *hunk)
+svn_diff_hunk_get_leading_context(const svn_diff_hunk_t *hunk)
 {
   return hunk->leading_context;
 }
 
 svn_linenum_t
-svn_diff_hunk_get_trailing_context(const svn_hunk_t *hunk)
+svn_diff_hunk_get_trailing_context(const svn_diff_hunk_t *hunk)
 {
   return hunk->trailing_context;
 }
@@ -181,7 +181,7 @@ parse_range(svn_linenum_t *start, svn_li
  * If REVERSE is TRUE, invert the hunk header while parsing it.
  * Do all allocations in POOL. */
 static svn_boolean_t
-parse_hunk_header(const char *header, svn_hunk_t *hunk,
+parse_hunk_header(const char *header, svn_diff_hunk_t *hunk,
                   const char *atat, svn_boolean_t reverse, apr_pool_t *pool)
 {
   const char *p;
@@ -406,7 +406,7 @@ hunk_readline(svn_stream_t *stream,
 }
 
 svn_error_t *
-svn_diff_hunk_readline_original_text(const svn_hunk_t *hunk,
+svn_diff_hunk_readline_original_text(const svn_diff_hunk_t *hunk,
                                      svn_stringbuf_t **stringbuf,
                                      const char **eol,
                                      svn_boolean_t *eof,
@@ -419,7 +419,7 @@ svn_diff_hunk_readline_original_text(con
 }
 
 svn_error_t *
-svn_diff_hunk_readline_modified_text(const svn_hunk_t *hunk,
+svn_diff_hunk_readline_modified_text(const svn_diff_hunk_t *hunk,
                                      svn_stringbuf_t **stringbuf,
                                      const char **eol,
                                      svn_boolean_t *eof,
@@ -432,14 +432,14 @@ svn_diff_hunk_readline_modified_text(con
 }
 
 svn_error_t *
-svn_diff_hunk_readline_diff_text(const svn_hunk_t *hunk,
+svn_diff_hunk_readline_diff_text(const svn_diff_hunk_t *hunk,
                                  svn_stringbuf_t **stringbuf,
                                  const char **eol,
                                  svn_boolean_t *eof,
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool)
 {
-  svn_hunk_t dummy;
+  svn_diff_hunk_t dummy;
   svn_stringbuf_t *line;
 
   SVN_ERR(svn_stream_readline_detect_eol(hunk->diff_text, &line, eol, eof,
@@ -510,7 +510,7 @@ parse_prop_name(const char **prop_name, 
  * recognized as context lines.  Allocate results in
  * RESULT_POOL.  Use SCRATCH_POOL for all other allocations. */
 static svn_error_t *
-parse_next_hunk(svn_hunk_t **hunk,
+parse_next_hunk(svn_diff_hunk_t **hunk,
                 svn_boolean_t *is_property,
                 const char **prop_name,
                 svn_diff_operation_kind_t *prop_operation,
@@ -771,8 +771,8 @@ parse_next_hunk(svn_hunk_t **hunk,
 static int
 compare_hunks(const void *a, const void *b)
 {
-  const svn_hunk_t *ha = *((const svn_hunk_t **)a);
-  const svn_hunk_t *hb = *((const svn_hunk_t **)b);
+  const svn_diff_hunk_t *ha = *((const svn_diff_hunk_t **)a);
+  const svn_diff_hunk_t *hb = *((const svn_diff_hunk_t **)b);
 
   if (ha->original_start < hb->original_start)
     return -1;
@@ -785,7 +785,7 @@ compare_hunks(const void *a, const void 
  * Ensure that all streams which were opened for HUNK are closed.
  */
 static svn_error_t *
-close_hunk(const svn_hunk_t *hunk)
+close_hunk(const svn_diff_hunk_t *hunk)
 {
   SVN_ERR(svn_stream_close(hunk->original_text));
   SVN_ERR(svn_stream_close(hunk->modified_text));
@@ -1116,7 +1116,7 @@ git_deleted_file(enum parse_state *new_s
 /* Add a HUNK associated with the property PROP_NAME to PATCH. */
 static svn_error_t *
 add_property_hunk(svn_patch_t *patch, const char *prop_name, 
-                  svn_hunk_t *hunk, svn_diff_operation_kind_t operation,
+                  svn_diff_hunk_t *hunk, svn_diff_operation_kind_t operation,
                   apr_pool_t *result_pool)
 {
   svn_prop_patch_t *prop_patch;
@@ -1129,13 +1129,14 @@ add_property_hunk(svn_patch_t *patch, co
       prop_patch = apr_palloc(result_pool, sizeof(svn_prop_patch_t));
       prop_patch->name = prop_name;
       prop_patch->operation = operation;
-      prop_patch->hunks = apr_array_make(result_pool, 1, sizeof(svn_hunk_t *));
+      prop_patch->hunks = apr_array_make(result_pool, 1,
+                                         sizeof(svn_diff_hunk_t *));
 
       apr_hash_set(patch->prop_patches, prop_name, APR_HASH_KEY_STRING,
                    prop_patch);
     }
 
-  APR_ARRAY_PUSH(prop_patch->hunks, svn_hunk_t *) = hunk;
+  APR_ARRAY_PUSH(prop_patch->hunks, svn_diff_hunk_t *) = hunk;
 
   return SVN_NO_ERROR;
 }
@@ -1275,14 +1276,15 @@ svn_diff_parse_next_patch(svn_patch_t **
     }
   else
     {
-      svn_hunk_t *hunk;
+      svn_diff_hunk_t *hunk;
       svn_boolean_t is_property;
       const char *last_prop_name;
       const char *prop_name;
       svn_diff_operation_kind_t prop_operation;
 
       /* Parse hunks. */
-      (*patch)->hunks = apr_array_make(result_pool, 10, sizeof(svn_hunk_t *));
+      (*patch)->hunks = apr_array_make(result_pool, 10,
+                                       sizeof(svn_diff_hunk_t *));
       (*patch)->prop_patches = apr_hash_make(result_pool);
       do
         {
@@ -1304,7 +1306,7 @@ svn_diff_parse_next_patch(svn_patch_t **
             }
           else if (hunk)
             {
-              APR_ARRAY_PUSH((*patch)->hunks, svn_hunk_t *) = hunk;
+              APR_ARRAY_PUSH((*patch)->hunks, svn_diff_hunk_t *) = hunk;
               last_prop_name = NULL;
             }
 
@@ -1335,7 +1337,8 @@ svn_diff_close_patch(const svn_patch_t *
 
   for (i = 0; i < patch->hunks->nelts; i++)
     {
-      const svn_hunk_t *hunk = APR_ARRAY_IDX(patch->hunks, i, svn_hunk_t *);
+      const svn_diff_hunk_t *hunk = APR_ARRAY_IDX(patch->hunks, i,
+                                                  svn_diff_hunk_t *);
       SVN_ERR(close_hunk(hunk));
     }
 

Modified: subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c?rev=990121&r1=990120&r2=990121&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c Fri Aug 27 12:11:37 2010
@@ -276,7 +276,7 @@ create_patch_file(apr_file_t **patch_fil
  * If ORIGINAL is TRUE, read the original hunk text; else, read the
  * modified hunk text. */
 static svn_error_t *
-check_content(svn_hunk_t *hunk, svn_boolean_t original,
+check_content(svn_diff_hunk_t *hunk, svn_boolean_t original,
               const char *expected, apr_pool_t *pool)
 {
   svn_stream_t *exp;
@@ -330,7 +330,7 @@ test_parse_unidiff(apr_pool_t *pool)
   for (i = 0; i < 2; i++)
     {
       svn_patch_t *patch;
-      svn_hunk_t *hunk;
+      svn_diff_hunk_t *hunk;
       apr_off_t pos;
 
       svn_pool_clear(iterpool);
@@ -349,7 +349,7 @@ test_parse_unidiff(apr_pool_t *pool)
       SVN_TEST_ASSERT(! strcmp(patch->new_filename, "A/C/gamma"));
       SVN_TEST_ASSERT(patch->hunks->nelts == 1);
 
-      hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+      hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
       SVN_ERR(check_content(hunk, ! reverse,
                             "This is the file 'gamma'." NL,
                             pool));
@@ -375,7 +375,7 @@ test_parse_unidiff(apr_pool_t *pool)
         }
       SVN_TEST_ASSERT(patch->hunks->nelts == 1);
 
-      hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+      hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
       SVN_ERR(check_content(hunk, ! reverse,
                             "This is the file 'gamma'." NL
                             "some less bytes to 'gamma'" NL,
@@ -398,7 +398,7 @@ test_parse_git_diff(apr_pool_t *pool)
 
   apr_file_t *patch_file;
   svn_patch_t *patch;
-  svn_hunk_t *hunk;
+  svn_diff_hunk_t *hunk;
   const char *fname = "test_parse_git_diff.patch";
 
   SVN_ERR(create_patch_file(&patch_file, fname, git_unidiff, pool));
@@ -425,7 +425,7 @@ test_parse_git_diff(apr_pool_t *pool)
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_modified);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
-  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "This is the file 'gamma'." NL,
@@ -470,7 +470,7 @@ test_parse_git_tree_and_text_diff(apr_po
 
   apr_file_t *patch_file;
   svn_patch_t *patch;
-  svn_hunk_t *hunk;
+  svn_diff_hunk_t *hunk;
   const char *fname = "test_parse_git_tree_and_text_diff.patch";
 
   SVN_ERR(create_patch_file(&patch_file, fname, git_tree_and_text_unidiff,
@@ -487,7 +487,7 @@ test_parse_git_tree_and_text_diff(apr_po
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_copied);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
-  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "This is the file 'iota'." NL,
@@ -509,7 +509,7 @@ test_parse_git_tree_and_text_diff(apr_po
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_moved);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
-  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "This is the file 'mu'." NL,
@@ -530,7 +530,7 @@ test_parse_git_tree_and_text_diff(apr_po
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
-  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "",
@@ -550,7 +550,7 @@ test_parse_git_tree_and_text_diff(apr_po
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_deleted);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
-  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "This is the file 'lambda'." NL,
@@ -568,7 +568,7 @@ test_bad_git_diff_headers(apr_pool_t *po
 {
   apr_file_t *patch_file;
   svn_patch_t *patch;
-  svn_hunk_t *hunk;
+  svn_diff_hunk_t *hunk;
   const char *fname = "test_bad_git_diff_header.patch";
 
   SVN_ERR(create_patch_file(&patch_file, fname, bad_git_diff_header,
@@ -584,7 +584,7 @@ test_bad_git_diff_headers(apr_pool_t *po
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_copied);
   SVN_TEST_ASSERT(patch->hunks->nelts == 1);
   
-  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "This is the file 'iota'." NL,
@@ -606,7 +606,7 @@ test_parse_property_diff(apr_pool_t *poo
   apr_file_t *patch_file;
   svn_patch_t *patch;
   svn_prop_patch_t *prop_patch;
-  svn_hunk_t *hunk;
+  svn_diff_hunk_t *hunk;
   apr_array_header_t *hunks;
   const char *fname = "test_parse_property_diff.patch";
 
@@ -630,7 +630,7 @@ test_parse_property_diff(apr_pool_t *poo
   hunks = prop_patch->hunks;
 
   SVN_TEST_ASSERT(hunks->nelts == 1);
-  hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 0 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "value" NL,
@@ -649,7 +649,7 @@ test_parse_property_diff(apr_pool_t *poo
   hunks = prop_patch->hunks;
 
   SVN_TEST_ASSERT(hunks->nelts == 1);
-  hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 0 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "",
@@ -667,7 +667,7 @@ test_parse_property_diff(apr_pool_t *poo
   hunks = prop_patch->hunks;
 
   SVN_TEST_ASSERT(hunks->nelts == 2);
-  hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 0 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "value" NL
@@ -683,7 +683,7 @@ test_parse_property_diff(apr_pool_t *poo
                         "context" NL,
                         pool));
 
-  hunk = APR_ARRAY_IDX(hunks, 1 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 1 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "context" NL
@@ -708,7 +708,7 @@ test_parse_property_and_text_diff(apr_po
   apr_file_t *patch_file;
   svn_patch_t *patch;
   svn_prop_patch_t *prop_patch;
-  svn_hunk_t *hunk;
+  svn_diff_hunk_t *hunk;
   apr_array_header_t *hunks;
   const char *fname = "test_parse_property_and_text_diff.patch";
 
@@ -726,7 +726,7 @@ test_parse_property_and_text_diff(apr_po
   SVN_TEST_ASSERT(apr_hash_count(patch->prop_patches) == 1);
 
   /* Check contents of text hunk */
-  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "This is the file 'iota'." NL,
@@ -744,7 +744,7 @@ test_parse_property_and_text_diff(apr_po
 
   hunks = prop_patch->hunks;
   SVN_TEST_ASSERT(hunks->nelts == 1);
-  hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 0 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "",
@@ -763,7 +763,7 @@ test_parse_diff_symbols_in_prop_unidiff(
   svn_patch_t *patch;
   apr_file_t *patch_file;
   svn_prop_patch_t *prop_patch;
-  svn_hunk_t *hunk;
+  svn_diff_hunk_t *hunk;
   apr_array_header_t *hunks;
   const char *fname = "test_parse_diff_symbols_in_prop_unidiff.patch";
 
@@ -787,7 +787,7 @@ test_parse_diff_symbols_in_prop_unidiff(
 
   hunks = prop_patch->hunks;
   SVN_TEST_ASSERT(hunks->nelts == 1);
-  hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 0 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "",
@@ -806,7 +806,7 @@ test_parse_diff_symbols_in_prop_unidiff(
 
   hunks = prop_patch->hunks;
   SVN_TEST_ASSERT(hunks->nelts == 1);
-  hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 0 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "--- iota" NL
@@ -823,7 +823,7 @@ test_parse_diff_symbols_in_prop_unidiff(
   SVN_TEST_ASSERT(prop_patch->operation == svn_diff_op_modified);
   hunks = prop_patch->hunks;
   SVN_TEST_ASSERT(hunks->nelts == 2);
-  hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 0 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "## -1,2 +1,2 ##" NL
@@ -839,7 +839,7 @@ test_parse_diff_symbols_in_prop_unidiff(
                         "Modified: prop_mod" NL,
                         pool));
 
-  hunk = APR_ARRAY_IDX(hunks, 1 , svn_hunk_t *);
+  hunk = APR_ARRAY_IDX(hunks, 1 , svn_diff_hunk_t *);
 
   SVN_ERR(check_content(hunk, TRUE,
                         "context" NL