You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2008/11/17 10:02:03 UTC

Re: svn commit: r34235 - in trunk/subversion: libsvn_wc tests/cmdline

Per my other email, this needs to be reverted.


On Nov 16, 2008, at 20:21, neels@tigris.org wrote:

> Author: neels
> Date: Sun Nov 16 17:21:55 2008
> New Revision: 34235
>
> Log:
> Fix failure to raise a distinct tree-conflict that is a sibling of  
> another
> tree-conflict raised in the same run: Do not defer tree-conflicts  
> via the log
> but record them immediately.
>
> * subversion/libsvn_wc/update_editor.c
>  (check_tree_conflict): Rename to check_and_store_tree_conflict().
>  (check_and_store_tree_conflict):
>    Renamed from check_tree_conflict(), because this function now  
> stores
>    a tree-conflict in the working copy immediately. Remove the  
> LOG_ACCUM
>    argument. Cosmetic change: initialize the return value further up.
>  (do_entry_deletion, add_directory, open_directory, add_file,  
> open_file):
>    Apply rename and functional change from check_tree_conflict() to
>    check_and_store_tree_conflict().
>
> * subversion/tests/cmdline/depth_tests.py
>  (make_depth_tree_conflicts):
>    Fix some dumb mis-expectations that still remain after above fixes
>    are applied.
>  (tree_conflicts_resolved_depth_immediates,
>   tree_conflicts_resolved_depth_infinity):
>    Change output expectation line arrays to UnorderedOutput.
>  (test_list):
>    Do not XFail tests tree_conflicts_resolved_depth_* since the bug is
>    now fixed and make_depth_tree_conflicts() now works.
>
> Modified:
>   trunk/subversion/libsvn_wc/update_editor.c
>   trunk/subversion/tests/cmdline/depth_tests.py
>
> Modified: trunk/subversion/libsvn_wc/update_editor.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/update_editor.c?pathrev=34235&r1=34234&r2=34235
> === 
> === 
> === 
> =====================================================================
> --- trunk/subversion/libsvn_wc/update_editor.c    Sun Nov 16  
> 11:58:26 2008    (r34234)
> +++ trunk/subversion/libsvn_wc/update_editor.c    Sun Nov 16  
> 17:21:55 2008    (r34235)
> @@ -1365,7 +1365,7 @@ tree_has_local_mods(svn_boolean_t *modif
>
> /* Check whether the incoming change ACTION on FULL_PATH would  
> conflict with
>  * FULL_PATH's scheduled change. If so, then raise a tree conflict  
> with
> - * FULL_PATH as the victim, by appending log actions to LOG_ACCUM.
> + * FULL_PATH as the victim, by recording it in the working copy.
>  *
>  * The edit baton EB gives information including whether the  
> operation is
>  * an update or a switch.
> @@ -1382,17 +1382,19 @@ tree_has_local_mods(svn_boolean_t *modif
>  * notest/tree-conflicts/detection.txt.
>  */
> static svn_error_t *
> -check_tree_conflict(svn_wc_conflict_description_t **pconflict,
> -                    struct edit_baton *eb,
> -                    svn_stringbuf_t *log_accum,
> -                    const char *full_path,
> -                    const svn_wc_entry_t *entry,
> -                    svn_wc_adm_access_t *parent_adm_access,
> -                    svn_wc_conflict_action_t action,
> -                    apr_pool_t *pool)
> +check_and_store_tree_conflict(svn_wc_conflict_description_t  
> **pconflict,
> +                              struct edit_baton *eb,
> +                              const char *full_path,
> +                              const svn_wc_entry_t *entry,
> +                              svn_wc_adm_access_t *parent_adm_access,
> +                              svn_wc_conflict_action_t action,
> +                              apr_pool_t *pool)
> {
>   svn_wc_conflict_reason_t reason = (svn_wc_conflict_reason_t)(-1);
>
> +  if (pconflict)
> +    *pconflict = NULL;
> +
>   switch (action)
>     {
>     case svn_wc_conflict_action_edit:
> @@ -1452,9 +1454,6 @@ check_tree_conflict(svn_wc_conflict_desc
>       break;
>     }
>
> -  if (pconflict)
> -    *pconflict = NULL;
> -
>   /* If a conflict was detected, append log commands to the log  
> accumulator
>    * to record it. */
>   if (reason != (svn_wc_conflict_reason_t)(-1))
> @@ -1468,13 +1467,7 @@ check_tree_conflict(svn_wc_conflict_desc
>       conflict->action = action;
>       conflict->reason = reason;
>
> -      /* Ensure 'log_accum' is non-null.  
> svn_wc__loggy_add_tree_conflict()
> -       * would otherwise quietly set it to point to a newly  
> allocated buffer
> -       * but we have no way to propagate that back to our caller. */
> -      SVN_ERR_ASSERT(log_accum != NULL);
> -
> -      SVN_ERR(svn_wc__loggy_add_tree_conflict(&log_accum, conflict,
> -                                              parent_adm_access,  
> pool));
> +      SVN_ERR(svn_wc__add_tree_conflict(conflict,  
> parent_adm_access, pool));
>
>       if (pconflict)
>         *pconflict = conflict;
> @@ -1626,17 +1619,10 @@ do_entry_deletion(struct edit_baton *eb,
>   /* Is this path the victim of a newly-discovered tree conflict? */
>   tree_conflict = NULL;
>   if (victim_path == NULL)
> -    SVN_ERR(check_tree_conflict(&tree_conflict, eb, log_item,  
> full_path,
> -                                entry, adm_access,
> -                                svn_wc_conflict_action_delete,  
> pool));
> -
> -  if (tree_conflict != NULL)
> -    {
> -      /* Run the log immediately, so that the tree conflict is  
> recorded. */
> -      SVN_ERR(svn_wc__write_log(adm_access, *log_number, log_item,  
> pool));
> -      SVN_ERR(svn_wc__run_log(adm_access, NULL, pool));
> -      *log_number = 0;
> -    }
> +    SVN_ERR(check_and_store_tree_conflict(&tree_conflict, eb,  
> full_path,
> +                                          entry, adm_access,
> +                                           
> svn_wc_conflict_action_delete,
> +                                          pool));
>
>   if (victim_path != NULL || tree_conflict != NULL)
>     {
> @@ -1655,7 +1641,6 @@ do_entry_deletion(struct edit_baton *eb,
>       return SVN_NO_ERROR;
>     }
>
> -  SVN_ERR(svn_wc__write_log(adm_access, *log_number, log_item,  
> pool));
>
>   /* If the thing being deleted is the *target* of this update, then
>      we may need to recreate an entry, so that the parent can give
> @@ -1950,10 +1935,9 @@ add_directory(const char *path,
>                                           pb->path, pool));
>
>               /* Raise a tree conflict if this directory is already  
> present. */
> -              SVN_ERR(check_tree_conflict(&tree_conflict, eb,
> -                                          pb->log_accum, db->path,  
> entry,
> -                                          parent_adm_access,
> -                                           
> svn_wc_conflict_action_add, pool));
> +              SVN_ERR(check_and_store_tree_conflict(
> +                        &tree_conflict, eb, db->path, entry,  
> parent_adm_access,
> +                        svn_wc_conflict_action_add, pool));
>
>               if (tree_conflict != NULL)
>                 {
> @@ -2173,9 +2157,9 @@ open_directory(const char *path,
>   else
>     /* Is this path a fresh tree conflict victim?  If so, skip the  
> tree
>        with one notification. */
> -    SVN_ERR(check_tree_conflict(&tree_conflict, eb, pb->log_accum,
> -                                full_path, entry, parent_adm_access,
> -                                svn_wc_conflict_action_edit, pool));
> +    SVN_ERR(check_and_store_tree_conflict(&tree_conflict, eb,
> +                                          full_path, entry,  
> parent_adm_access,
> +                                           
> svn_wc_conflict_action_edit, pool));
>
>   /* If property-conflicted, skip the tree with notification. */
>   SVN_ERR(svn_wc_conflicted_p2(NULL, &prop_conflicted, NULL,  
> full_path,
> @@ -2973,9 +2957,10 @@ add_file(const char *path,
>   /* Is this path the victim of a newly-discovered tree conflict? */
>   tree_conflict = NULL;
>   if (victim_path == NULL)
> -    SVN_ERR(check_tree_conflict(&tree_conflict, eb, pb->log_accum,  
> full_path,
> -                                entry, adm_access,
> -                                svn_wc_conflict_action_add,  
> subpool));
> +    SVN_ERR(check_and_store_tree_conflict(&tree_conflict, eb,  
> full_path,
> +                                          entry, adm_access,
> +                                          svn_wc_conflict_action_add,
> +                                          subpool));
>
>   if (victim_path != NULL || tree_conflict != NULL)
>     {
> @@ -3137,9 +3122,9 @@ open_file(const char *path,
>   /* Is this path the victim of a newly-discovered tree conflict? */
>   tree_conflict = NULL;
>   if (victim_path == NULL)
> -    SVN_ERR(check_tree_conflict(&tree_conflict, eb, pb->log_accum,  
> full_path,
> -                                entry, adm_access,
> -                                svn_wc_conflict_action_edit, pool));
> +    SVN_ERR(check_and_store_tree_conflict(&tree_conflict, eb,  
> full_path,
> +                                          entry, adm_access,
> +                                           
> svn_wc_conflict_action_edit, pool));
>
>   /* Does the file already have text or property conflicts? */
>   SVN_ERR(svn_wc_conflicted_p2(&text_conflicted, &prop_conflicted,  
> NULL,
>
> Modified: trunk/subversion/tests/cmdline/depth_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/depth_tests.py?pathrev=34235&r1=34234&r2=34235
> === 
> === 
> === 
> =====================================================================
> --- trunk/subversion/tests/cmdline/depth_tests.py    Sun Nov 16  
> 11:58:26 2008    (r34234)
> +++ trunk/subversion/tests/cmdline/depth_tests.py    Sun Nov 16  
> 17:21:55 2008    (r34235)
> @@ -2327,10 +2327,14 @@ def make_depth_tree_conflicts(sbox):
>   expected_status.tweak('A/mu',
>                         'A/B', 'A/B/lambda',
>                         'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
> +                        'A/B/F',
>                         'A/D/gamma',
>                         status='D ')
>   expected_status.tweak('A/mu', 'A/B', 'A/D/gamma',
>                         treeconflict='C', wc_rev='1')
> +  expected_status.tweak('A/B/lambda', 'A/B/E', 'A/B/F',
> +                        'A/B/E/alpha', 'A/B/E/beta',
> +                        wc_rev='1')
>
>   svntest.actions.run_and_verify_update(wc,
>                                         expected_output,
> @@ -2384,8 +2388,9 @@ def tree_conflicts_resolved_depth_immedi
>   B =    j(A, 'B')
>
>   svntest.actions.run_and_verify_svn(None,
> -    ["Resolved conflicted state of '%s'\n" % m,
> -     "Resolved conflicted state of '%s'\n" % B],
> +    svntest.verify.UnorderedOutput(
> +      ["Resolved conflicted state of '%s'\n" % m,
> +       "Resolved conflicted state of '%s'\n" % B]),
>     [],
>     'resolved', '--depth=immediates', A)
>
> @@ -2404,9 +2409,10 @@ def tree_conflicts_resolved_depth_infini
>
>
>   svntest.actions.run_and_verify_svn(None,
> -    ["Resolved conflicted state of '%s'\n" % m,
> -     "Resolved conflicted state of '%s'\n" % B,
> -     "Resolved conflicted state of '%s'\n" % g],
> +    svntest.verify.UnorderedOutput(
> +      ["Resolved conflicted state of '%s'\n" % m,
> +       "Resolved conflicted state of '%s'\n" % B,
> +       "Resolved conflicted state of '%s'\n" % g]),
>     [],
>     'resolved', '--depth=infinity', A)
>
> @@ -2448,10 +2454,10 @@ test_list = [ None,
>               excluded_path_update_operation,
>               excluded_path_misc_operation,
>               excluded_receive_remote_removal,
> -              XFail(tree_conflicts_resolved_depth_empty),
> -              XFail(tree_conflicts_resolved_depth_files),
> -              XFail(tree_conflicts_resolved_depth_immediates),
> -              XFail(tree_conflicts_resolved_depth_infinity),
> +              tree_conflicts_resolved_depth_empty,
> +              tree_conflicts_resolved_depth_files,
> +              tree_conflicts_resolved_depth_immediates,
> +              tree_conflicts_resolved_depth_infinity,
>             ]
>
> if __name__ == "__main__":
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org