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

Re: svn commit: r16141 - in trunk/subversion: libsvn_wc tests/clients/cmdline/svntest

From: Daniel L. Rall <dlr_at_finemaltcoding.com>
Date: 2005-09-19 07:27:28 CEST

On Sun, 18 Sep 2005, Philip Martin wrote:

> dlr@tigris.org writes:
>
> > Author: dlr
> > Date: Thu Sep 15 18:55:47 2005
> > New Revision: 16141
>
> > --- trunk/subversion/libsvn_wc/copy.c (original)
> > +++ trunk/subversion/libsvn_wc/copy.c Thu Sep 15 18:55:47 2005
> > @@ -516,19 +516,31 @@
> > {
> > svn_wc_adm_access_t *adm_access;
> > svn_node_kind_t src_kind;
> > - const svn_wc_entry_t *entry;
> > + const svn_wc_entry_t *dst_entry, *src_entry;
> > + const char *src_path_dir, *src_path_file;
> >
> > - SVN_ERR (svn_wc_entry (&entry, svn_wc_adm_access_path (dst_parent),
> > + SVN_ERR (svn_wc_adm_probe_open3 (&adm_access, NULL, src_path, FALSE, -1,
> > + cancel_func, cancel_baton, pool));
> > +
> > + SVN_ERR (svn_wc_entry (&dst_entry, svn_wc_adm_access_path (dst_parent),
> > dst_parent, FALSE, pool));
> > - if (entry->schedule == svn_wc_schedule_delete)
> > + SVN_ERR (svn_path_split_if_file (src_path, &src_path_dir, &src_path_file,
> > + pool));
>
> split_if_file queries the physical filesystem rather than the entries
> data. It's important to maintain the distinction between the
> versioned filesystem, as described by the entries files, and the
> physical filesystem since they do not always match and that can lead
> to strange errors.
 
Gotcha -- r16155.

> You have already read the entries for src_path so you could get the
> entry and query it, but perhaps a simple svn_wc_adm_access_path would
> do the right thing.
 
It did, thanks Philip!

> > + SVN_ERR (svn_wc_entry (&src_entry, src_path_dir, adm_access, FALSE, pool));
> > + if (strcmp (src_entry->repos, dst_entry->repos) != 0)
> > + return svn_error_createf
> > + (SVN_ERR_WC_INVALID_SCHEDULE, NULL,
> > + _("Cannot copy to '%s', as it is not from repository '%s'"),
> > + svn_path_local_style (svn_wc_adm_access_path (dst_parent), pool),
> > + src_entry->repos);
> > + if (dst_entry->schedule == svn_wc_schedule_delete)
> > return svn_error_createf
> > (SVN_ERR_WC_INVALID_SCHEDULE, NULL,
> > _("Cannot copy to '%s' as it is scheduled for deletion"),
> > svn_path_local_style (svn_wc_adm_access_path (dst_parent), pool));
> >
> > - SVN_ERR (svn_wc_adm_probe_open3 (&adm_access, NULL, src_path, FALSE, -1,
> > - cancel_func, cancel_baton, pool));
> > -
> > + /* ### Can this call be avoided, since we now already have
> > + ### src_entry->kind, or is it still needed for error handling? */
> > SVN_ERR (svn_io_check_path (src_path, &src_kind, pool));
>
> svn_io_check_path is probably unnecessary.

I've removed this comment, as in the case where the source resource is a
file, src_entry will point to its parent directory instead, which is not
what we want.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Sep 19 07:28:12 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.