[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Annotate broken on trunk on Win32

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2006-02-06 21:01:48 CET

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
          brane

* subversion/libsvn_client/blame.c
  (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?

Regards,
Malcolm

Index: subversion/libsvn_client/blame.c
===================================================================
--- 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. */
   if (window)
@@ -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,
                                          &translation_tgt,
                                          frb->tmp_path,
                                          ".tmp",
                                          svn_io_file_del_on_pool_cleanup,
                                          frb->currpool));
       SVN_ERR (svn_subst_copy_and_translate3 (dbaton->filename,
                                               translation_tgt,
                                               frb->eol_str, FALSE,
                                               NULL, FALSE, FALSE,
                                               frb->currpool));
- 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: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 6 21:04:28 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.