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

Re: tree-conflicts: add-on-add with directories

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 08 Dec 2008 12:08:40 +0000

On Mon, 2008-12-08 at 11:50 +0000, Julian Foad wrote:
> Neels Janosch Hofmeyr wrote:
> > I've just found out that we're not actually raising a tree-conflict upon an
> > added-added conflict involving only a directory. It *is* reported on files
> > when similarly named files are in the two added dirs.
> >
> > See attached reproduction script (which was aiming at testing whether such
> > an add-add conflict on a dir was blocked when stepping into it).
>
> It's tested by tree_conflict_tests.py 8 "up/sw dir: add onto add", which
> is XFAIL.
>
> This code is in update_editor.c:add_directory():
> [[[
> else /* Obstructing dir *is* versioned or scheduled for addition. */
> {
> const svn_wc_entry_t *entry;
>
> SVN_ERR(svn_wc_entry(&entry, db->path, adm_access, FALSE, pool));
>
> /* Anything other than a dir scheduled for addition without
> history is an error. */
> /* ### what's this "add_existed" clause for? */
> if (entry
> && entry->schedule == svn_wc_schedule_add
> && ! entry->copied)
> {
> db->add_existed = TRUE;
> }
> else
> {
> (Raise a tree conflict)
> }
> ]]]
>
> The case of a directory already scheduled for addition WITHOUT HISTORY
> is treated as a special case. I couldn't understand why, and wrote that
> "###" comment. One of us can take another look at it some time and see
> if we can figure it out.

Oh, I remember... I asked on-list in
<http://svn.haxx.se/dev/archive-2008-10/1083.shtml>. Paul replied:
> That was related to a follow-up to the "takeover" functionality, and
> was filed as issue #2593.
>
> See also (the threads are many and a bit broken, but these are the key
> points):
>
> Mark describes the problem:
> http://svn.haxx.se/dev/archive-2006-08/0336.shtml
> Your thoughts: http://svn.haxx.se/dev/archive-2006-08/0718.shtml
> My proposed patch: http://svn.haxx.se/dev/archive-2006-09/0362.shtml

(The rest of that thread drifted onto a different topic.)

Back then, I was saying: We automatically merge the addition of
identical hunks in a text file, because that is very likely the desired
result even though it is not guaranteed to be right semantically. We
ought to merge automatically any two identical changes, including the
addition of two identical directories, for the same reason.

I didn't go into the details of "identical": what if the two directories
have the same name but different properties? or different children?

Anyway, that's why we merge two directory adds. But why we don't
automatically merge them if the existing one is add-with-history...
that's unresolved, and is really just because we haven't defined the
meaning of "identical" or what we should do if we find they're similar
but not quite identical in terms of their copy-from source.

So, in terms of tree conflicts, it's a known special case. I think we
should re-examine and change it, but I don't think we need to do so for
1.6.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=981119
Received on 2008-12-08 13:09:07 CET

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.