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

Re: [PATCH]Use the library-internal version of translated_file()

From: Hyrum K. Wright <hyrum_at_hyrumwright.org>
Date: Sat, 15 Aug 2009 20:44:25 -0500

On Aug 14, 2009, at 10:55 PM, HuiHuang wrote:

> Hey,
>
> Log:
> [[[
> Use the library-internal version of translated_file().
>
> * subversion/libsvn_wc/diff.c
> (file_diff, report_wc_file_as_added, close_file): Call
> svn_wc__internal_translated_file()
> in favor of svn_wc_translated_file2().
>
> * subversion/libsvn_wc/log.c
> (install_committed_file): Call svn_wc__internal_translated_file()
> in favor of
> svn_wc_translated_file2().
>
> * subversion/libsvn_wc/merge.c
> (preserve_pre_merge_files): Call
> svn_wc__internal_translated_file() in favor of
> svn_wc_translated_file2().
>
> * subversion/libsvn_wc/update_editor.c
> (merge_file): Call svn_wc__internal_translated_file() in favor of
> svn_wc_translated_file2().
> ]]]

Haven't thoroughly reviewed the patch yet, but diff test 48 fails
after I apply it. I suspect it's just an absolute path that the
expected output of the test isn't smart enough to deal with, but this
failure needs to be fixed before the patch can be applied.

Thanks,
-Hyrum

>
> Modified:
> trunk/subversion/libsvn_wc/diff.c
> trunk/subversion/libsvn_wc/log.c
> trunk/subversion/libsvn_wc/merge.c
> trunk/subversion/libsvn_wc/update_editor.c
>
> Index: subversion/libsvn_wc/diff.c
> ===================================================================
> --- subversion/libsvn_wc/diff.c (版本 38761)
> +++ subversion/libsvn_wc/diff.c (工作副本)
> @@ -678,11 +678,10 @@
> SVN_ERR(get_working_mimetype(&working_mimetype, NULL,
> local_abspath,
> eb->db, pool, pool));
>
> - SVN_ERR(svn_wc_translated_file2
> - (&translated, path, path, adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> - pool));
> + SVN_ERR(svn_wc__internal_translated_file
> + (&translated, local_abspath, eb->db, local_abspath,
> + SVN_WC_TRANSLATE_TO_NF |
> SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> + pool, pool));
>
> SVN_ERR(dir_baton->edit_baton->callbacks->file_added
> (NULL, NULL, NULL, NULL, path,
> @@ -710,12 +709,10 @@
> tmp translated copy too. But what the heck, diff is
> already expensive, translating twice for the sake of code
> modularity is liveable. */
> - SVN_ERR(svn_wc_translated_file2
> - (&translated, path,
> - path, adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> - pool));
> + SVN_ERR(svn_wc__internal_translated_file
> + (&translated, local_abspath, eb->db, local_abspath,
> + SVN_WC_TRANSLATE_TO_NF |
> SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> + pool, pool));
> }
>
> if (modified || propchanges->nelts > 0)
> @@ -1150,12 +1147,10 @@
> else
> source_file = path;
>
> - SVN_ERR(svn_wc_translated_file2
> - (&translated_file,
> - source_file, path, adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> - pool));
> + SVN_ERR(svn_wc__internal_translated_file
> + (&translated_file, source_file, eb->db, local_abspath,
> + SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> + pool, pool));
>
> SVN_ERR(eb->callbacks->file_added
> (adm_access, NULL, NULL, NULL,
> @@ -2428,12 +2423,10 @@
> localfile = svn_wc__text_base_path(b->path, FALSE, b->pool);
> else
> /* a detranslated version of the working file */
> - SVN_ERR(svn_wc_translated_file2
> - (&localfile, b->path,
> - b->path, adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> - pool));
> + SVN_ERR(svn_wc__internal_translated_file
> + (&localfile, local_abspath, eb->db, local_abspath,
> + SVN_WC_TRANSLATE_TO_NF |
> SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
> + pool, pool));
> }
> else
> localfile = temp_file_path = NULL;
> Index: subversion/libsvn_wc/log.c
> ===================================================================
> --- subversion/libsvn_wc/log.c (版本 38761)
> +++ subversion/libsvn_wc/log.c (工作副本)
> @@ -363,11 +363,10 @@
> {
> const char *tmp = (kind == svn_node_file) ? tmp_text_base :
> filepath;
>
> - SVN_ERR(svn_wc_translated_file2(&tmp_wfile,
> - tmp,
> - filepath, adm_access,
> - SVN_WC_TRANSLATE_FROM_NF,
> - pool));
> + SVN_ERR(svn_wc__internal_translated_file(&tmp_wfile, tmp, db,
> + file_abspath,
> +
> SVN_WC_TRANSLATE_FROM_NF,
> + pool, pool));
>
> /* If the translation is a no-op, the text base and the working
> copy
> * file contain the same content, because we use the same props
> here
> Index: subversion/libsvn_wc/merge.c
> ===================================================================
> --- subversion/libsvn_wc/merge.c (版本 38761)
> +++ subversion/libsvn_wc/merge.c (工作副本)
> @@ -564,8 +564,12 @@
> const char *parent, *target_base;
> svn_wc_adm_access_t *parent_access;
> const char *adm_path = svn_wc_adm_access_path(adm_access);
> + const char *merge_abstarget;
> + svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
> svn_wc_entry_t tmp_entry;
>
> + SVN_ERR(svn_dirent_get_absolute(&merge_abstarget, merge_target,
> pool));
> +
> /* I miss Lisp. */
>
> SVN_ERR(svn_io_open_uniquely_named(NULL,
> @@ -654,13 +658,10 @@
>
> /* Back up MERGE_TARGET through detranslation/retranslation:
> the new translation properties may not match the current ones */
> - SVN_ERR(svn_wc_translated_file2(&detranslated_target_copy,
> - merge_target,
> - merge_target,
> - adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - |
> SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP,
> - pool));
> + SVN_ERR(svn_wc__internal_translated_file
> + (&detranslated_target_copy, merge_abstarget, db,
> merge_abstarget,
> + SVN_WC_TRANSLATE_TO_NF |
> SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP,
> + pool, pool));
> SVN_ERR(svn_wc__loggy_translated_file
> (log_accum, adm_access,
> target_copy, detranslated_target_copy, merge_target,
> pool));
> Index: subversion/libsvn_wc/update_editor.c
> ===================================================================
> --- subversion/libsvn_wc/update_editor.c (版本 38761)
> +++ subversion/libsvn_wc/update_editor.c (工作副本)
> @@ -4452,11 +4452,10 @@
>
> /* Copy and DEtranslate the working file to a temp text-
> base.
> Note that detranslation is done according to the old
> props. */
> - SVN_ERR(svn_wc_translated_file2(&tmptext, fb->path, fb-
> >path,
> - adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - |
> SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP,
> - pool));
> + SVN_ERR(svn_wc__internal_translated_file
> + (&tmptext, local_abspath, eb->db, local_abspath,
> + SVN_WC_TRANSLATE_TO_NF |
> SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP,
> + pool, pool));
>
> /* A log command that copies the tmp-text-base and
> REtranslates
> it back to the working file.
>
> Best
> Huihuang
> ------------------
> yellow.flying
> 2009-08-15
> ��i��'�ē扫h∈&
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2383814

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2383964
Received on 2009-08-16 03:45:12 CEST

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