You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2011/08/17 20:14:49 UTC

svn commit: r1158854 - in /subversion/trunk/subversion: libsvn_client/cat.c libsvn_client/client.h libsvn_client/merge.c tests/cmdline/merge_tests.py

Author: pburba
Date: Wed Aug 17 18:14:48 2011
New Revision: 1158854

URL: http://svn.apache.org/viewvc?rev=1158854&view=rev
Log:
Follow-up to r961254: Fix issue #3989 'merge which deletes file with native
eol-style raises spurious tree conflict'.

* subversion/libsvn_client/client.h

  (svn_client__get_normalized_stream): Add a new argument

* subversion/libsvn_client/cat.c

  (svn_client__get_normalized_stream): Don't "normalize" eols to the value
   of the svn:eol-style property (if such is set).  Rather, normalize eols
   to SVN_SUBST_NATIVE_EOL_STR if asked to do so and the svn:eol-property
   is set or leave the eols as is otherwise.

  (svn_client_cat2): Update call to svn_client__get_normalized_stream,
   keeping prior behavior, that eols not be normalized.

* subversion/libsvn_client/merge.c

  (files_same_p): Update call to svn_client__get_normalized_stream, asking
   that eols be normalized.

* subversion/tests/cmdline/merge_tests.py

  (merged_deletion_causes_tree_conflict): Remove XFail decorator and comment.

Modified:
    subversion/trunk/subversion/libsvn_client/cat.c
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/tests/cmdline/merge_tests.py

Modified: subversion/trunk/subversion/libsvn_client/cat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/cat.c?rev=1158854&r1=1158853&r2=1158854&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/cat.c (original)
+++ subversion/trunk/subversion/libsvn_client/cat.c Wed Aug 17 18:14:48 2011
@@ -50,6 +50,7 @@ svn_client__get_normalized_stream(svn_st
                                   const char *local_abspath,
                                   const svn_opt_revision_t *revision,
                                   svn_boolean_t expand_keywords,
+                                  svn_boolean_t normalize_eols,
                                   svn_cancel_func_t cancel_func,
                                   void *cancel_baton,
                                   apr_pool_t *result_pool,
@@ -163,8 +164,10 @@ svn_client__get_normalized_stream(svn_st
 
   /* Wrap the output stream if translation is needed. */
   if (eol != NULL || kw != NULL)
-    input = svn_subst_stream_translated(input, eol, FALSE, kw, expand_keywords,
-                                        result_pool);
+    input = svn_subst_stream_translated(
+      input,
+      (eol_style && normalize_eols) ? SVN_SUBST_NATIVE_EOL_STR : eol,
+      FALSE, kw, expand_keywords, result_pool);
 
   *normal_stream = input;
 
@@ -211,7 +214,7 @@ svn_client_cat2(svn_stream_t *out,
 
       SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url, pool));
       SVN_ERR(svn_client__get_normalized_stream(&normal_stream, ctx->wc_ctx,
-                                            local_abspath, revision, TRUE,
+                                            local_abspath, revision, TRUE, FALSE,
                                             ctx->cancel_func, ctx->cancel_baton,
                                             pool, pool));
 

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1158854&r1=1158853&r2=1158854&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Wed Aug 17 18:14:48 2011
@@ -1051,13 +1051,21 @@ svn_client__ensure_revprop_table(apr_has
 
 /* Return a potentially translated version of local file LOCAL_ABSPATH
    in NORMAL_STREAM.  REVISION must be one of the following: BASE, COMMITTED,
-   WORKING.  Uses SCRATCH_POOL for temporary allocations. */
+   WORKING.
+
+   EXPAND_KEYWORDS operates as per the EXPAND argument to
+   svn_subst_stream_translated, which see.  If NORMALIZE_EOLS is TRUE and
+   LOCAL_ABSPATH requires translation, then normalize the line endings in
+   *NORMAL_STREAM.
+
+   Uses SCRATCH_POOL for temporary allocations. */
 svn_error_t *
 svn_client__get_normalized_stream(svn_stream_t **normal_stream,
                                   svn_wc_context_t *wc_ctx,
                                   const char *local_abspath,
                                   const svn_opt_revision_t *revision,
                                   svn_boolean_t expand_keywords,
+                                  svn_boolean_t normalize_eols,
                                   svn_cancel_func_t cancel_func,
                                   void *cancel_baton,
                                   apr_pool_t *result_pool,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1158854&r1=1158853&r2=1158854&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Aug 17 18:14:48 2011
@@ -1854,7 +1854,7 @@ files_same_p(svn_boolean_t *same,
       /* Compare the file content, translating 'mine' to 'normal' form. */
       SVN_ERR(svn_client__get_normalized_stream(&mine_stream, wc_ctx,
                                                 mine_abspath, &working_rev,
-                                                FALSE, NULL, NULL,
+                                                FALSE, TRUE, NULL, NULL,
                                                 scratch_pool, scratch_pool));
 
       SVN_ERR(svn_stream_open_readonly(&older_stream, older_abspath,

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1158854&r1=1158853&r2=1158854&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Wed Aug 17 18:14:48 2011
@@ -16975,7 +16975,6 @@ def reverse_merge_adds_subtree(sbox):
 # A test for issue #3989 'merge which deletes file with native eol-style
 # raises spurious tree conflict'.
 @Issue(3989)
-@XFail(svntest.main.is_os_windows)
 @SkipUnless(server_has_mergeinfo)
 def merged_deletion_causes_tree_conflict(sbox):
   "merged deletion causes spurious tree conflict"
@@ -17009,22 +17008,9 @@ def merged_deletion_causes_tree_conflict
 
   # Sync merge ^/A/D/H to branch/D/H.
   #
-  # Currently this fails because a spurious tree conflict is raised:
-  #
-  #   >svn merge ^^/A branch
-  #   --- Merging r3 through r4 into 'branch':
-  #      C branch\D\H\psi
-  #   --- Recording mergeinfo for merge of r3 through r4 into 'branch':
-  #    U   branch
-  #   Summary of conflicts:
-  #     Tree conflicts: 1
-  #
-  #   >svn st
-  #    M      branch
-  #         C branch\D\H\psi
-  #         >   local edit, incoming delete upon merge
-  #   Summary of conflicts:
-  #     Tree conflicts: 1
+  # branch/D/H/psi is, ignoring differences caused by svn:eol-style, identical
+  # to ^/A/D/H/psi when the latter was deleted, so the deletion should merge
+  # cleanly.
   svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
   expected_output = wc.State(H_branch_path, {
     'psi' : Item(status='D '),