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

Re: Adding file/directory to a directory with identical name but not same node.

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-03-31 22:09:08 CEST

Hi Garrett,

Below are my investigation on this issue.
In subversion/libsvn_repos/commit.c:add_directory(),
I could see the following comment before creating the svn_fs_make_dir which
should be corrected once we fix the issue,
      "/* No ancestry given, just make a new directory. We don't
         bother with an out-of-dateness check here because
         svn_fs_make_dir will error out if PATH already exists.
         Verify write access to the full path and the parent
         directory. */".

To throw 'Out of date error' we need base_revision of the parent
directory of
the node getting added inside add_directory and add_file.
Currently both add_directory, add_file in subversion/libsvn_repos/commit.c
recieve parent_baton, unfortunately parent_baton->base_rev happens to be
The subversion/libsvn_client/commit_util.c:svn_client__do_commit() has the
following line because of that parent_baton->base_rev is '-1' when seen from
SVN_ERR(svn_delta_path_driver(editor, edit_baton, SVN_INVALID_REVNUM,
                                paths, do_item_commit, &cb_baton, pool));
Changing the SVN_INVALID_REVNUM with base_revision of the concerned parent
directory should help us in throwing 'Out of date parent'.

Not sure of the consequences though.

With regards
Kamesh Jayachandran

Kamesh Jayachandran wrote:
> Thanks Garrett. Will try to understand why this succeed and get back.
> With regards
> Kamesh Jayachandran
> Garrett Rooney wrote:
>> On 3/21/06, Kamesh Jayachandran <kamesh@collab.net> wrote:
>>> Hi All,
>>> Outdated working copy has a directory /abc and tries to create a sub
>>> directory xyz under /abc, meanwhile the /abc has been deleted and
>>> readded from some other working copy should the commit from Outdated
>>> working copy succeed?
>>> It seems to succeed not sure whether it is the correct behaviour.
>>> P.S: This is a repost of post with a subject 'Clarification needed'
>>> with
>>> a better subject line.
>>> Below snippet will exhibit the behaviour.
>>> #######snippet starts############
>>> cd /tmp
>>> rm -rf repos
>>> svnadmin create repos --fs-type=bdb
>>> rm -rf wc
>>> mkdir wc
>>> svn mkdir file:///tmp/repos/abc -m 'creating abc'
>>> curdir=`pwd`
>>> svn co file:///tmp/repos wc/wc1
>>> svn co file:///tmp/repos wc/wc2
>>> cd wc/wc1
>>> svn rm abc
>>> svn ci -m 'removing abc from wc1'
>>> svn mkdir file:///tmp/repos/abc -m 'creating abc again from wc1'
>>> cd $curdir
>>> cd wc/wc2
>>> svn mkdir abc/xyz
>>> svn ci -m 'creating xyz under abc from wc2'
>>> #######snippet ends############
>> Seems kind of odd to me, I don't know off the top of my head why it's
>> succeeding. It sure feels like it shouldn't be.
>> -garrett
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 31 22:10:31 2006

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