On 8/21/06, Paul Burba <paulb@softlanding.com> wrote:
> "Ivan Zhakov" <chemodax@gmail.com> wrote on 08/19/2006 03:07:15 AM:
>
> > There are some small glitches, see my comments inside.
> >
> > Index: subversion/libsvn_wc/copy.c
> > ===================================================================
> > --- subversion/libsvn_wc/copy.c (revision 21115)
> > +++ subversion/libsvn_wc/copy.c (working copy)
> > @@ -39,6 +39,242 @@
> >
> > /*** Code. ***/
> >
> > +/* Helper function for svn_wc_copy2() which handles WC->WC copying of
> > + files which are scheduled for addition or unversioned.
> > +
> > + Copy SRC_PATH to DST_PATH.
> > +
> > + DST_PATH is a non-existant path, but it's parent must exist
> > + and be in the same WC as SRC_PATH.
> > +
> > + If SRC_IS_ADDED is true then SRC_PATH is scheduled for addition and
> > + DST_PATH will also be scheduled for addition.
> > +
> > + If SRC_IS_ADDED is false then SRC_PATH is the unversioned child
> > + file of a versioned or added parent and DST_PATH is simply copied.
> > +
> > + DST_PARENT_ACCESS is a 0 depth locked access for the
> > + versioned parent dir of DST_PATH.
> > +
> > + Use POOL for all necessary allocations.
> > +*/
> > +static svn_error_t *
> > +copy_added_file_administratively(const char *src_path,
> > + const char *dst_path,
> > + svn_boolean_t src_is_added,
> > + svn_wc_adm_access_t
> *dst_parent_access,
> > + svn_cancel_func_t cancel_func,
> > + void *cancel_baton,
> > + svn_wc_notify_func2_t notify_func,
> > + void *notify_baton,
> > + apr_pool_t *pool)
> > +{
> > + char *src_parent = svn_path_dirname(src_path, pool);
> >
> > Btw, what do you think about split dst_path parameter to dst_parent
> > and dst_basename in parameters in
> > copy_added_file_administratively/copy_added_dir_administratively?
> > Because you are joining it when calling function and further splitting
> > it function body. It also will be more coordinated with
> > copy_file_administratively/copy_dir_administratively.
>
> I changed dst_path to dst_basename as you suggested to avoid the redundant
> join/split. But adding dst_parent seems unecessary, since
> dst_parent_access already has the path dst_parent readily
> available..
Ok, I've missed this.
> Unless you meant that svn_wc_adm_access_t *dst_parent_access
> should instead be named dst_parent(?). If so I really prefer the name
> with the "_access" suffix as it makes the code easier to read when
> variables representing path names are easily distinguished from
> svn_wc_adm_access_t pointers.
I'm prefer name without "_access" suffix as it present in other
functions, but I keep this to you.
> I also added the argument svn_wc_adm_access_t *src_access to
> copy_added_dir_administratively() since svn_wc_copy2() already has a -1
> unlocked access and there is no reason for me to open/close another
> access, we can simply retrieve the access out of src_access.
>
> Comments for both helper functions updated.
>
[snip
> Ok, I think this is about ready if you think these latest changes look ok.
Yes, I think the same way. I'm +1 for commit.
>
> Paul B.
>
> [[[
> Support copy and move of paths scheduled for addition.
>
> Follow-up to r20811.
>
> Suggested by: zhakov
>
> * subversion/libsvn_wc/copy.c
> (copy_added_file_administratively, copy_added_dir_administratively):
> New recursive helper functions for copying added paths and unversioned
> children within added directories.
> (svn_wc_copy2): Use new helper functions when copying added paths.
>
> * subversion/tests/cmdline/copy_tests.py
> (copy_move_added_paths, copy_added_paths_to_URL,): New tests.
> (test_list): Run new tests.
> ]]]
>
>
>
>
--
Ivan Zhakov
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 21 18:55:20 2006