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