You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kamesh Jayachandran <ka...@collab.net> on 2006/03/21 13:54:39 UTC

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

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############

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 3/31/06, Kamesh Jayachandran <ka...@collab.net> wrote:
> 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
> '-1'.
> 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
> add_directory/add_file.
> 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.

Well, only one way to find out.  I'd suggest making that change to the
call to svn_delta_path_driver and inserting the out of dateness check,
and then seeing how the test suite deals with it.  Maybe there's a
reason it's done this way, maybe not, but either way the test suite
should be able to tell us more.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


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

Posted by Kamesh Jayachandran <ka...@collab.net>.
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 
'-1'.
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
add_directory/add_file.
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 <ka...@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

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

Posted by Kamesh Jayachandran <ka...@collab.net>.
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 <ka...@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

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

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 3/21/06, Kamesh Jayachandran <ka...@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