[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: HuiHuang <yellow.flying_at_yahoo.com.cn>
Date: Mon, 17 Aug 2009 12:49:37 +0800

Hey,

I have fixed the issue and make a new patch, see below:
Thanks:)

Log:

[[[
Use the library-internal version of translated_file() and tweak
diff_external_diffcmd test to use absolute path.

 * subversion/tests/cmdline/diff_tests.py
   (diff_external_diffcmd): Modify expected output as absolute path.

 * 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/tests/cmdline/diff_tests.py
    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/tests/cmdline/diff_tests.py
===================================================================
--- subversion/tests/cmdline/diff_tests.py (版本 38767)
+++ subversion/tests/cmdline/diff_tests.py (工作副本)
@@ -2954,7 +2954,7 @@
     "-L\n",
     "iota\t(working copy)\n",
     os.path.join('.svn', 'text-base', 'iota.svn-base') + "\n",
- "iota\n"])
+ os.path.abspath("iota") + "\n"])
 
   # Check that the output of diff corresponds with the expected
arguments,
   # in the correct order.
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c (版本 38767)
+++ 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.
Index: subversion/libsvn_wc/merge.c
===================================================================
--- subversion/libsvn_wc/merge.c (版本 38767)
+++ 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/diff.c
===================================================================
--- subversion/libsvn_wc/diff.c (版本 38767)
+++ 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 (版本 38767)
+++ 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

Best~
Huihuang

__________________________________________________
�Ͽ�ע���Ż��������������?
http://cn.mail.yahoo.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2384206
Received on 2009-08-17 06:50:40 CEST

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