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

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

From: HuiHuang <yellow.flying_at_yahoo.com.cn>
Date: Sat, 15 Aug 2009 11:55:10 +0800

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().
]]]

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
Received on 2009-08-15 05:57:16 CEST

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.