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

Re: tree conflicts and directories discussion

From: Nico Schellingerhout <nico.schellingerhout_at_philips.com>
Date: Thu, 3 Apr 2008 08:40:27 +0200

Stefan Sperling <stsp_at_elego.de> wrote on 04/02/2008 07:29:53 PM:

> Hello tree conflict fans,
>
> I've started thinking a bit about tree conflicts and directories.
>
> The problem: We want to be able to also mark directories as
> tree conflict victims. The current code, however, only considers
> files. See http://subversion.tigris.org/issues/show_bug.cgi?id=3150
>
> I thought it might be a good idea for all of us to agree on
> how directories can become tree conflict victims before we
> start implementing anything :)
>
> To kick off a discussion, I've translated the entries about
> each use case in notes/tree-conflicts/detection.txt from
> files to directories.
>
> Here is the result, please note the open question in use case 5.
>
> Comments and additions welcome, as usual.
>
> -----------------------------------------------------------------------
>
> In all the cases below (except possibly one exception, noted inline)
> we never descend into directories recursively. We only consider
> the direct children of the directory in question.
>
> ==========
> USE CASE 1
> ==========
>
> File:
> If 'svn update' modifies a file that has been scheduled for deletion
> in the working copy, the file is a tree conflict victim.
>
> Directory:
> If 'svn update' modifies a file in a directory that has been scheduled
> for deletion in the working copy, the directory is a tree conflict
victim.

See my reaction to your next post.

>
> ==========
> USE CASE 2
> ==========
>
> File:
> If 'svn update' deletes a file that has local modifications, the file
> is a tree conflict victim.
>
> Directory:
> If 'svn update' deletes a directory that contains a file with local
> modifications, the directory is a tree conflict victim.

Yes. Where local modifications would mean: any addition, deletion,
property change, _or_ file modification anywhere in the subtree rooted
by the directory.

>
> ==========
> USE CASE 3
> ==========
>
> File:
> If 'svn update' deletes a file that has been scheduled for deletion in
> the working copy, the file is a tree conflict victim.
>
> Directory:
> If 'svn update' deletes a directory that has been scheduled for deletion
in
> the working copy, the directory is a tree conflict victim.

Yes.

>
> ==========
> USE CASE 4
> ==========
>
> Files:
> If 'svn merge' tries to modify a file that does not exist in the
> target working copy, then the target file is a tree conflict victim.
>
> Directories:
> If 'svn merge' tries to modify a file in a directory that does not exist
> in the target working copy, then the target directory is a tree
> conflict victim.
>
> ==========
> USE CASE 5
> ==========
>
> Files:
> If 'svn merge' deletes an existing file, the file is a tree conflict
> victim if its text is different from the corresponding file on the left
> side of the merge source.
>
> Directories:
> If 'svn merge' deletes an existing directory, the directory is a tree
conflict
> victim if its content is different from the corresponding directory
> on the left
> side of the merge source.
>
> Question here: What makes two directories "equal"? Do we need to
consider
> all subdirectories of a directory? Or should we keep it simple and only
> consider direct children as in all the other cases?
> Warning: The former might perform quite badly!

I'm afraid the answer has to be: the former (see comment with use case 2).

Performance may be bad, but should scale with the size of the tree being
deleted, so that should be acceptable. (It doesn't happen every day that
you rename your entire source tree.)

Actually, once Subversion gets a better understanding of "moves"
the performance could be improved a lot for the move cases (which are
most common), because in most cases no conflict would arise.

>
> ==========
> USE CASE 6
> ==========
>
> File:
> If 'svn merge' tries to delete a file that does not exist in the
> target working copy, then the target file is a tree conflict victim.
>
> Directory:
> If 'svn merge' tries to delete a directory that does not exist in the
> target working copy, then the target directory is a tree conflict
victim.

Yes.

>
> =========================
> OBSTRUCTIONS DURING MERGE
> =========================
>
> File:
> If 'svn merge' fails to apply an operation to a file because the
> file is obstructed (i.e. an unversioned item of the same name is
> in the file's place), the obstructed file is a tree conflict victim.
>
> Directory:
> If 'svn merge' fails to apply an operation to a directory because the
> directory is obstructed (i.e. an unversioned item of the same name is
> in the directory's place), the obstructed directory is a tree conflict
> victim.

Yes.

- Nico
Received on 2008-04-03 08:39:28 CEST

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.