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

Re: svn commit: rev 2024 - trunk/subversion/include trunk/subversion/libsvn_wc trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_local trunk/subversion/libsvn_client trunk/subversion/svnlook trunk/subversion/libsvn_ra_pipe trunk/subversion/clients/cmdline trunk/subversion/tests/libsvn_wc trunk/subversion/tests/libsvn_subr trunk/subversion/tests/clients/cmdline trunk/subversion/tests/libsvn_delta trunk/subversion/libsvn_repos trunk/subversion/libsvn_delta trunk/subversion/libsvn_ra_dav

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-05-29 01:31:47 CEST

kfogel@tigris.org writes:

> Modified: trunk/subversion/libsvn_wc/diff.c
> ==============================================================================
> --- trunk/subversion/libsvn_wc/diff.c (original)
> +++ trunk/subversion/libsvn_wc/diff.c Tue May 28 16:19:10 2002
> @@ -281,7 +285,7 @@
> * may not exist in the working copy.
> */
> static struct file_baton *
> -make_file_baton (const svn_stringbuf_t *name,
> +make_file_baton (const char *name,
> svn_boolean_t added,
> struct dir_baton *parent_baton)
> {
> @@ -298,8 +302,8 @@
> /* The path is allocated in the directory's pool since it will be put
> into the directory's list of already diff'd entries, and must continue
> to exist after we have finished with this file. */
> - file_baton->path = svn_stringbuf_dup (parent_baton->path, parent_baton->pool);
> - svn_path_add_component (file_baton->path, name);
> + file_baton->path = svn_path_join (parent_baton->path, name,
> + parent_baton->pool);
>
> /* If the parent directory is added rather than replaced it does not
> exist in the working copy. Determine a working copy path that does
> @@ -314,9 +318,15 @@
> while (wc_dir_baton->added)
> wc_dir_baton = wc_dir_baton->dir_baton;
>
> - file_baton->wc_path = svn_stringbuf_dup (wc_dir_baton->path,
> - file_baton->pool);
> - svn_path_add_component (file_baton->wc_path, name);
> + /* ### I do not understand this code. We ascend to some
> + directory that's not being added, and then set fb->wc_path to
> + that directory plus this file's entry name! How can that be
> + right? We're appending this file's name onto some random
> + directory above it, possibly many levels above it. Someone
> + hit me over the head with the Clue Stick, please. -kff */

We need to be able to create temporary files associated with this
file. If the parent directory is added rather than replaced then this
editor, unlike the update editor, will not have created the new
directory. If we try to create a temporary file using 'path' it will
be impossible since there will not be a suitable .svn/tmp/ dir. It is
possible to create a temporary file using 'wc_path' since that is a
path into an existing directory.

It's all part of the mess that is temporary file handling. As noted
in one of the TODOs at the top of the file, it would be better if
there was some (APR?) interface to provide the equivalent of /tmp or
TMPDIR. Without such an interface the choice is to assume that either
the wc or '.' is writeable, this editor chooses to use the wc.

> +
> + file_baton->wc_path = svn_path_join (wc_dir_baton->path, name,
> + file_baton->pool);
> }
> else
> {

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 29 01:32:47 2002

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.