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

Re: svn commit: r16183 - trunk/subversion/libsvn_fs_base

From: <kfogel_at_collab.net>
Date: 2005-09-21 16:03:08 CEST

cmpilato@tigris.org writes:
> Log:
> Fix a code ordering problem, whereby uninitialized variables are used
> as if they were initialized.
>
> My (hopefully not so sloppy) followup to r16128, which was my sloppy
> follow-up to my sloppy r15569. For the good of Subversion, please
> review this commit.

:-) Done.

> * subversion/libsvn_fs_base/tree.c
> (merge): Move the less costly ID-based conflict check above the
> node-kind-based check, and then move the node fetching above the
> node-kind-based check which depends on it.
>
> --- trunk/subversion/libsvn_fs_base/tree.c (original)
> +++ trunk/subversion/libsvn_fs_base/tree.c Wed Sep 21 09:36:14 2005
> @@ -2063,15 +2063,6 @@
> a_entry->name,
> iterpool));
>
> - /* If any of the three entries is of type file, flag a conflict. */
> - if ((svn_fs_base__dag_node_kind (s_ent_node) == svn_node_file)
> - || (svn_fs_base__dag_node_kind (t_ent_node) == svn_node_file)
> - || (svn_fs_base__dag_node_kind (a_ent_node) == svn_node_file))
> - return conflict_err (conflict_p,
> - svn_path_join (target_path,
> - a_entry->name,
> - iterpool));
> -
> /* If either SOURCE-ENTRY or TARGET-ENTRY is not a direct
> modification of ANCESTOR-ENTRY, declare a conflict. */
> if (strcmp (svn_fs_base__id_node_id (s_entry->id),
> @@ -2087,15 +2078,26 @@
> a_entry->name,
> iterpool));
>
> - /* Direct modifications were made to the directory
> - ANCESTOR-ENTRY in both SOURCE and TARGET. Recursively
> - merge these modifications. */
> + /* Fetch the nodes for our entries. */
> SVN_ERR (svn_fs_base__dag_get_node (&s_ent_node, fs,
> s_entry->id, trail, iterpool));
> SVN_ERR (svn_fs_base__dag_get_node (&t_ent_node, fs,
> t_entry->id, trail, iterpool));
> SVN_ERR (svn_fs_base__dag_get_node (&a_ent_node, fs,
> a_entry->id, trail, iterpool));
> +
> + /* If any of the three entries is of type file, flag a conflict. */
> + if ((svn_fs_base__dag_node_kind (s_ent_node) == svn_node_file)
> + || (svn_fs_base__dag_node_kind (t_ent_node) == svn_node_file)
> + || (svn_fs_base__dag_node_kind (a_ent_node) == svn_node_file))
> + return conflict_err (conflict_p,
> + svn_path_join (target_path,
> + a_entry->name,
> + iterpool));
> +
> + /* Direct modifications were made to the directory
> + ANCESTOR-ENTRY in both SOURCE and TARGET. Recursively
> + merge these modifications. */
> new_tpath = svn_path_join (target_path, t_entry->name, iterpool);
> SVN_ERR (merge (conflict_p, new_tpath,
> t_ent_node, s_ent_node, a_ent_node,

Looks good to me, dude.

-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 21 17:10:14 2005

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