Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > Re: [PATCH]Use the library-internal version of translated_file()

subversion
Discussion topic

Back to topic list

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

Author hwright
Full name Hyrum K. Wright
Date 2009-08-15 18:44:38 PDT
Message 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_tra​nslated_file()
> in favor of svn_wc_translated_file2().
>
> * subversion/libsvn_wc/log.c
> (install_committed_file): Call svn_wc__internal_tra​nslated_file()
> in favor of
> svn_wc_translated_file2().
>
> * subversion/libsvn_wc/merge.c
> (preserve_pre_merge_files): Call
> svn_wc__internal_tra​nslated_file() in favor of
> svn_wc_translated_file2().
>
> * subversion/libsvn_wc​/update_editor.c
> (merge_file): Call svn_wc__internal_tra​nslated_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/lib​svn_wc/diff.c
> trunk/subversion/lib​svn_wc/log.c
> trunk/subversion/lib​svn_wc/merge.c
> trunk/subversion/lib​svn_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(&workin​g_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__inte​rnal_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->cal​lbacks->file_adde​d
> (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__inte​rnal_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__inte​rnal_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->callb​acks->file_added
> (adm_access, NULL, NULL, NULL,
> @@ -2428,12 +2423,10 @@
> localfile = svn_wc__text_base_pa​th(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__inte​rnal_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_trans​lated_file2(&tmp​_wfile,
> - tmp,
> - filepath, adm_access,
> - SVN_WC_TRANSLATE_FROM_NF,
> - pool));
> + SVN_ERR(svn_wc__inte​rnal_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_pa​th(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_g​et_absolute(&mer​ge_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_trans​lated_file2(&det​ranslated_target_cop​y,
> - merge_target,
> - merge_target,
> - adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - |
> SVN_WC_TRANSLATE_NO_​OUTPUT_CLEANUP,
> - pool));
> + SVN_ERR(svn_wc__inte​rnal_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__logg​y_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_trans​lated_file2(&tmp​text, fb->path, fb-
> >path,
> - adm_access,
> - SVN_WC_TRANSLATE_TO_NF
> - |
> SVN_WC_TRANSLATE_NO_​OUTPUT_CLEANUP,
> - pool));
> + SVN_ERR(svn_wc__inte​rnal_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.ti​gris.org/ds/viewMess​age.do?dsForumId=462​&dsMessageId=238​3814

« Previous message in topic | 2 of 3 | Next message in topic »

Messages

Show all messages in topic

[PATCH]Use the library-internal version of translated_file() yellowflying HuiHuang 2009-08-14 20:56:50 PDT
     Re: [PATCH]Use the library-internal version of translated_file() hwright Hyrum K. Wright 2009-08-15 18:44:38 PDT
         Re: [PATCH]Use the library-internal version of translated_file() yellowflying HuiHuang 2009-08-16 21:49:58 PDT
Messages per page: