On Sat, Apr 26, 2008 at 02:02:46PM +0800, Rui, Guo wrote:
> > Hmm. I'm not sure I follow here. I agree that svn_wc_add2 doesn't
> > provide a way to specify the right depth, but I think it would be
> > perfectly reasonable to just add a depth argument to it, which is
> > ignored for file arguments.
> >
> > I'm not sure that the "write something incorrect to disk, then write
> > the correct thing" is better than just "introduce arguments that let
> > you write the right thing in the first place".
> >
>
> Well, it's a hard decision here and I'm not sure that I made the right
> decision. The standpoint is that svn_wc_add2() is used in many situations:
> add, merge and copy etc. The depth only makes sense in a small piece of
> situations. That is, adding a directory (not files, which should be much more
> than dir) in 'svn add' command. If such a parameter is introduced, most of the
> time it only add the burden to the caller (to fill in a nonsense) and looks
> ugly.
>
> An alternative should be just introduce a specialized svn_wc_add_dir() only
> for 'svn add' and don't make it deprecate svn_wc_add2() (as we generally do
> when we introduce something like svn_wc_add3()). Does this seem to be a better
> choice? In this way, the default_and_fix way will still have to be used, to
> reuse the implementation in svn_wc_add2(). However, this dirty trick will not
> expose to the client.
Does it looks better now? See these:
svn_add2.diff:
[[[
Make the --depth option in svn add works in the same way as svn ci, up etc.
* subversion/include/svn_wc.h
(svn_wc_add_depth_dir): Declare the new function that specialized for adding
directory with depth.
* subversion/libsvn_wc/adm_ops.c
(svn_wc_add2): Update the comment about depth to indicate that this function
default to svn_depth_infinity
(svn_wc_add_depth_dir): New specialized function that add directory with
correct depth.
* subversion/libsvn_client/add.c
(add_dir_recursive, add_parent_dirs): Call svn_wc_add_depth_dir() instead
for directory.
(add): Pass all directory target to add_dir_recursive, otherwise adjustment
will also be needed here.
* subversion/tests/cmdline/depth_tests.py
(add_tree_with_depth_files): verify depth & added new tests for the --force
& --parents situation
]]]
svn_add2_cleanup.diff: (not modified, except for line numbers)
[[[
Some cleanups:
* subversion/include/svn_client.h
(svn_client_add3): Update the document that -N is mapped to svn_depth_empty
* subversion/libsvn_client/add.c
(svn_client_add4): Fold up duplicated code in both path of a branch
(svn_client_add3): Map the -N to svn_depth_empty, make it consistent with
the mapping in svn/main.c
]]]
Rui, Guo
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-26 09:37:58 CEST