Index: subversion/libsvn_delta/svndiff.c =================================================================== --- subversion/libsvn_delta/svndiff.c (revision 1416173) +++ subversion/libsvn_delta/svndiff.c (working copy) @@ -34,6 +34,8 @@ #include "private/svn_error_private.h" #include "private/svn_delta_private.h" +static void log_window(svn_txdelta_window_t *window); + /* The zlib compressBound function was not exported until 1.2.0. */ #if ZLIB_VERNUM >= 0x1200 #define svnCompressBound(LEN) compressBound(LEN) @@ -230,9 +232,9 @@ } /* encode the window header. */ - header_current[0] = 0; /* source offset == 0 */ - header_current[1] = 0; /* source length == 0 */ - header_current = encode_int(header_current + 2, window->tview_len); + header_current = encode_int(header_current, window->sview_offset); + header_current = encode_int(header_current, window->sview_len); + header_current = encode_int(header_current, window->tview_len); header_current[0] = (unsigned char)ip_len; /* 1 instruction */ header_current = encode_int(&header_current[1], len); @@ -263,6 +265,8 @@ const svn_txdelta_op_t *op; apr_size_t len; + log_window(window); + /* use specialized code if there is no source */ if (window && !window->src_ops && window->num_ops == 1 && !eb->version) return svn_error_trace(send_simple_insertion_window(window, eb)); @@ -770,6 +774,21 @@ return SVN_NO_ERROR; } +static void +log_window(svn_txdelta_window_t *window) +{ + if (window) + fprintf(stderr, "handler window: " + "{sview_offset = %ld, sview_len = %ld, tview_len = %ld, num_ops = %d, " + "src_ops = %d, ops->action = %s, new_data = 0x%x}\n", + window->sview_offset, window->sview_len, window->tview_len, + window->num_ops, window->src_ops, + window->ops->action_code == svn_txdelta_new ? "svn_txdelta_new" : "?", + window->new_data); + else + fprintf(stderr, "handler window: null\n"); +} + static svn_error_t * write_handler(void *baton, const char *buffer, @@ -877,6 +896,7 @@ inslen, newlen, p, db->subpool, db->version)); SVN_ERR(db->consumer_func(&window, db->consumer_baton)); + log_window(&window); /* Make a new subpool and buffer, saving aside the remaining data in the old buffer. */