On Sat, Feb 04, 2006 at 10:21:26PM +0100, Branko Čibej wrote:
> It seems that blame is applying deltas to the translated buffer, not the
> untranslated one. That's seriously broken.
Spot on. I think this was caused by the fix to issue #2431 in r17513.
The change to libsvn_client/blame.c:window_handler() in that revision
sets (struct delta_baton *)->filename to the translated file's name,
just before we assign it to (struct delta_baton *)->last_filename,
the source for the next delta.
I think the attached patch should resolve that, though I can't reproduce
the problem on Darwin - even with a file that does need translation.
Having said that, it looks fairly straightforward. Can someone try this
out on Windows and confirm whether it fixes the problem?
Fix blame for translated files. Followup to r17513.
Found by: djh
(window_handler): Introduce a local variable to hold the name of
the temporary translated file, so that the delta source for the next
revision will use the untranslated file.
Incidentally, the fix for issue #2431 doesn't appear to have changed
old_blame() at all. Presumably this means the original issue is still
outstanding for 1.0.x servers?
--- subversion/libsvn_client/blame.c (revision 18349)
+++ subversion/libsvn_client/blame.c (working copy)
@@ -1,11 +1,11 @@
* blame.c: return blame messages
- * Copyright (c) 2000-2004 CollabNet. All rights reserved.
+ * Copyright (c) 2000-2006 CollabNet. All rights reserved.
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://subversion.tigris.org/license-1.html.
* If newer versions of this license are posted there, you may use a
* newer version instead, at your option.
@@ -310,12 +310,13 @@
static svn_error_t *
window_handler (svn_txdelta_window_t *window, void *baton)
struct delta_baton *dbaton = baton;
struct file_rev_baton *frb = dbaton->file_rev_baton;
+ const char *translation_tgt = dbaton->filename;
/* Call the wrapped handler first. */
SVN_ERR (dbaton->wrapped_handler (window, dbaton->wrapped_baton));
/* We patiently wait for the NULL window marking the end. */
@@ -329,31 +330,28 @@
SVN_ERR (svn_io_file_close (dbaton->source_file, frb->currpool));
SVN_ERR (svn_io_file_close (dbaton->file, frb->currpool));
if (svn_subst_translation_required (frb->eol_style, frb->eol_str,
NULL, FALSE, FALSE))
- const char *translation_tgt;
SVN_ERR (svn_io_open_unique_file2 (NULL,
SVN_ERR (svn_subst_copy_and_translate3 (dbaton->filename,
NULL, FALSE, FALSE,
- dbaton->filename = translation_tgt;
/* Process this file. */
SVN_ERR (add_file_blame (frb->last_filename,
- dbaton->filename, frb));
+ translation_tgt, frb));
/* Prepare for next revision. */
/* Remember the file name so we can diff it with the next revision. */
frb->last_filename = dbaton->filename;
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Mon Feb 6 21:04:28 2006