You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Michael Susser <hd...@googlemail.com> on 2008/11/27 07:43:09 UTC
Re: Error when creating tags from working copy
I have read that Karl has retired ;-) Is there anybody else who can help me?
Regards,
Michael
2008/10/26 Karl Fogel <kf...@red-bean.com>
> "Michael Susser" <hd...@googlemail.com> writes:
> > do you have any news?
>
> Not yet, but I've been traveling for more than a week now and haven't
> had time to dig further yet. I will post here as soon as I know more.
>
> -Karl
>
> > Greetings,
> > Michael
> >
> > 2008/10/12 Karl Fogel <kf...@red-bean.com>
> >
> > This is a deep one. I'm posting what I've learned so far in case
> anyone
> > has any hunches. On the client, the problem is that in
> >
> > libsvn_ra_neon/commit.c:commit_add_file()
> >
> > the following code should get a "file not found" error (i.e., an HTTP
> > 404) when it probes for the existence of the file we're about to add,
> > but doesn't -- instead, it's as though the file already exists:
> >
> > svn_ra_neon__resource_t *res;
> > svn_error_t *err = svn_ra_neon__get_starting_props(&res,
> >
> file->cc->ras,
> >
> file->rsrc->wr_url,
> > NULL,
> workpool);
> > if (!err)
> > {
> > /* If the PROPFIND succeeds the file already exists */
> > return svn_error_createf(SVN_ERR_RA_DAV_ALREADY_EXISTS,
> NULL,
> > _("File '%s' already exists"),
> > file->rsrc->url);
> > }
> >
> > Here's what happens on the server side. Let's shortcut directly to
> > mod_dav_svn/repos.c:get_resource(). Before the call to
> > prep_resource()...
> >
> > /* prepare the resource for operation */
> > if ((err = prep_resource(comb)) != NULL)
> > return err;
> >
> > ...comb->exists is 0, as we would want (so is comb->res.exists, for
> that
> > matter). But after prep_resource(), comb->exists is 1!
> >
> > prep_resource() is just a dispatch function; the real stuff happens
> in
> > prep_working() (because comb->res.type == DAV_RESOURCE_TYPE_WORKING).
> > In prep_working(), we get all the way to this code near the end:
> >
> > derr = fs_check_path(&kind, comb->priv.root.root,
> > comb->priv.repos_path, pool);
> >
> > if (derr != NULL)
> > return derr;
> >
> > comb->res.exists = (kind == svn_node_none) ? FALSE : TRUE;
> > comb->res.collection = (kind == svn_node_dir) ? TRUE : FALSE;
> >
> > So that's where comb->res.exists gets set to 1. (I'm not sure where
> > comb->exists gets set to 1, which might be important, but see below.)
> >
> > Anyway, that call to fs_check_path() sets kind to svn_node_file, even
> > though the file shouldn't be present in this txn yet (that's why
> we're
> > adding it).
> >
> > Tracing fs_check_path --> svn_fs_fs__check_path() --> node_kind() -->
> > fs_node_id() --> get_dag() --> open_path() --> svn_fs_fs__dag_open(),
> > shows that, somehow, the file is actually there, according to the FS.
> > (It does not appear to be a dag node caching problem; the node isn't
> > found in the cache, instead we find it the old-fashioned way, right
> > there in the filesystem.)
> >
> > Back up in
> http-2.2.9/modules/dav/main/mod_dav.c:dav_method_propfind(),
> > this all matters because of this code:
> >
> > /* Ask repository module to resolve the resource */
> > err = dav_get_resource(r, 1 /* label_allowed */, 0 /*
> use_checked_in */,
> > &resource);
> > if (err != NULL)
> > return dav_handle_err(r, err, NULL);
> >
> > if (dav_get_resource_state(r, resource) == DAV_RESOURCE_NULL) {
> > /* Apache will supply a default error for this. */
> > return HTTP_NOT_FOUND;
> > }
> >
> > Not only does dav_get_resource() not get an error, but the call to
> > dav_get_resource_state() will not return DAV_RESOURCE_NULL, because
> that
> > code (in httpd-2.2.9/modules/dav/main/util_lock.c) says:
> >
> > if (resource->exists)
> > return DAV_RESOURCE_EXISTS;
> >
> > Boom. If it weren't for that, the function would return
> > DAV_RESOURCE_NULL and we'd be fine.
> >
> > Note that in the reproduction recipe, if you insert an "svn up
> Data/wc"
> > right before the final svn cp in the reproduction recipe, then none
> of
> > this weirdness happens, and the bug doesn't reproduce.
> >
> > So why does the file claim to be present in the txn already? And why
> > does updating the whole working copy to r2 (instead of having a mixed
> > r1/r2 working copy) cause the repository filesystem to correctly
> answer
> > that the file is not there?
> >
> > I don't know. I will continue to debug, but if anyone has any
> inspired
> > ideas, please post.
> >
> > -Karl
> >
> > Karl Fogel <kf...@red-bean.com> writes:
> > > "Michael Susser" <hd...@googlemail.com> writes:
> > >> i have found a bug when creating tags from working copy in svn
> 1.5.2
> > >> (and also 1.5.3). Here is a recipe how to reproduce the error: (my
> > >> apache is configured to host the repositories in E:\SVNRep)
> > >>
> > >> [...]
> > >>
> > >> svn copy -m"tagging" E:\Data\wc\trunk
> http://myserver/svn/repo/tags/
> > V1.0.0
> > >>>svn: Commit failed (details follow):
> > >>>svn: File '/svn/repo/tags/V1.0.0/dir/file.cpp' already exists
> > >
> > > Thank you for the excellent recipe. I can reproduce this, and have
> > > written a Unix Bourne shell reproduction script (see below). Note
> that
> > > this only reproduces over http://. If you try it with svn:// or
> > > file://, the tagging works fine.
> > >
> > >> This error message is absolutely wrong! I investigated what went
> wrong
> > and
> > >> found the following: after the commit action the working copy is
> not
> > updated
> > >> correctly(?). The changed file "file.cpp" gets a new revision (2),
> but
> > its
> > >> parent directory "dir" stays at revision 1. Is this ok?
> > >
> > > Well, that part is okay. When you commit, only the committed items
> get
> > > their revisions bumped locally -- in other words, a commit does not
> do
> > > an update on the items that are not part of the commit. However,
> > > Subversion is supposed to transparently handle the resultant mixed
> > > revisions. They shouldn't matter here.
> > >
> > > This bug seems familiar, like we've either fixed it before or filed
> an
> > > issue for it. I'll check the logs and the issue tracker. But we
> have a
> > > reproduction recipe, so that means we can fix it or re-fix it :-).
> > >
> > >
> >
> ----------------------------------------------------------------------------
> > > #!/bin/sh
> > >
> > > # The next line is the only line you should need to adjust.
> > > SVNDIR=/home/kfogel/src/subversion
> > >
> > > SVN=${SVNDIR}/subversion/svn/svn
> > > SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
> > > SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin
> > >
> > > # Select an access method. If svn://, the svnserve setup is
> > > # handled automagically by this script; but if http://, then
> > > # you'll have to configure it yourself first.
> > > #
> > > URL=http://localhost/ms/repos
> > > # URL=svn://localhost/repos
> > > # URL=file:///`pwd`/repos
> > >
> > > rm -rf repos wc Data import-me
> > >
> > > ${SVNADMIN} create repos
> > >
> > > # These are for svnserve only.
> > > echo "[general]" > repos/conf/svnserve.conf
> > > echo "anon-access = write" >> repos/conf/svnserve.conf
> > > echo "auth-access = write" >> repos/conf/svnserve.conf
> > >
> > > # The server will only be contacted if $URL is svn://foo, of
> course.
> > > ${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
> > > # And put the kill command in a file, in case need to run it
> manually.
> > > echo "kill -9 `cat svnserve-pid`" > k
> > > chmod a+rwx k
> > >
> > > mkdir Data
> > > svn co ${URL} Data/wc
> > > mkdir Data/wc/tags
> > > mkdir Data/wc/trunk
> > > mkdir Data/wc/trunk/dir
> > > cp /dev/null Data/wc/trunk/dir/file.cpp
> > > ${SVN} add Data/wc/t*
> > > ${SVN} ci -m"test" Data/wc
> > >
> > > echo "ABC" >> Data/wc/trunk/dir/file.cpp
> > >
> > > ${SVN} ci -m"test" Data/wc
> > >
> > > # Using http:// only, the next command fails with this error:
> > > #
> > > # subversion/libsvn_client/copy.c:1319: (apr_err=175005)
> > > # svn: Commit failed (details follow):
> > > # subversion/libsvn_ra_neon/commit.c:1036: (apr_err=175005)
> > > # svn: File '/ms/repos/tags/V1.0.0/dir/file.cpp' already exists
> > > #
> > > ${SVN} copy -m"tagging" Data/wc/trunk ${URL}/tags/V1.0.0
> > >
> > > ./k
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
>
Re: Error when creating tags from working copy
Posted by David Weintraub <qa...@gmail.com>.
It looks like you're right. My understanding is that there are four
different types of copies in Subversion:
WC -> WC
URL -> WC
WC -> URL
URL -> URL
And, that when you do a copy to a URL, no actual copying happens. Instead, a
simple link is made from one URL and version to another.
That would mean that a working copy having multiple revisions in it wouldn't
pick up all those revisions since only a single URL and version are linked..
However, I just did a quick test. In a test repository, I checked out a
project, then updated one file to a previous revision. This way, the whole
directory has multiple revisions in it. Then I did:
$ svn cp . http://subversion/dev/foo/tags/TEST
I then executed:
$ svn log -v http://subversion/dev/foo/tags/TEST
------------------------------------------------------------------------
r46989 | dweintraub | 2008-12-01 12:48:24 -0500 (Mon, 01 Dec 2008) | 2 lines
Changed paths:
A /foo/tags/TEST (from /foo/trunk:46988)
R /foo/tags/TEST/build.xml (from /foo/trunk/build.xml:20137)
Testing
[...]
So, Subversion actually did pick up the different revisions in side my
working directory when it created the tag.
I assume the same thing happens if I had a different revision in a directory
than a file. However, I am using Subversion 1.3 as a client.
--
David Weintraub
qazwart@gmail.com
On Mon, Dec 1, 2008 at 3:57 AM, Michael Susser <hd...@googlemail.com>wrote:
> Hi David,
>
> this can't be true, because it worked with all versions until 1.5.2. "Tag
> from working copy" would make no sense if all files must have the same
> revision...
>
> Regards,
> Michael
>
> 2008/11/30 David Weintraub <qa...@gmail.com>
>
>> Well, you've hit another limit on the "tags as branches" method used in
>> Subversion. Since tags are simply a copy from a particular revision of the
>> repository, you can't make a tag via a simple copy unless all the files are
>> in the same revision.
>> The only way I've found around this is to make a tag via a standard
>> revision, checkout that tag, then copy the changes you want one-by-one over
>> the tag. I use a script to do this.
>>
>> --
>> David Weintraub
>> qazwart@gmail.com
>>
>
Re: Error when creating tags from working copy
Posted by Michael Susser <hd...@googlemail.com>.
Hi David,
this can't be true, because it worked with all versions until 1.5.2. "Tag
from working copy" would make no sense if all files must have the same
revision...
Regards,
Michael
2008/11/30 David Weintraub <qa...@gmail.com>
> Well, you've hit another limit on the "tags as branches" method used in
> Subversion. Since tags are simply a copy from a particular revision of the
> repository, you can't make a tag via a simple copy unless all the files are
> in the same revision.
> The only way I've found around this is to make a tag via a standard
> revision, checkout that tag, then copy the changes you want one-by-one over
> the tag. I use a script to do this.
>
> --
> David Weintraub
> qazwart@gmail.com
>
Re: Error when creating tags from working copy
Posted by David Weintraub <qa...@gmail.com>.
Well, you've hit another limit on the "tags as branches" method used in
Subversion. Since tags are simply a copy from a particular revision of the
repository, you can't make a tag via a simple copy unless all the files are
in the same revision.
The only way I've found around this is to make a tag via a standard
revision, checkout that tag, then copy the changes you want one-by-one over
the tag. I use a script to do this.
--
David Weintraub
qazwart@gmail.com
On Fri, Nov 28, 2008 at 8:02 AM, Michael Susser <hd...@googlemail.com>wrote:
> Forget my last post - I updated the wrong path. If I insert
>
> svn update E:\Data\wc\trunk
>
> just before the copy command in my recipe, it works as expected. But that
> is not what I want. If I update the working copy, I get all changes from
> other developers. Bye bye "tag from working copy" ;-)
>
> Regards,
> Michael
>
> 2008/11/28 Michael Susser <hd...@googlemail.com>
>
> Just tried that - and got the same error message.
>>
>> Regards,
>> Michael
>> 2008/11/27 David Weintraub <qa...@gmail.com>
>>
>>> What if you do an "svn update" before you do your copy?
>>> --
>>> David Weintraub
>>> qazwart@gmail.com
>>
>>
>
Re: Error when creating tags from working copy
Posted by Michael Susser <hd...@googlemail.com>.
Forget my last post - I updated the wrong path. If I insert
svn update E:\Data\wc\trunk
just before the copy command in my recipe, it works as expected. But that is
not what I want. If I update the working copy, I get all changes from other
developers. Bye bye "tag from working copy" ;-)
Regards,
Michael
2008/11/28 Michael Susser <hd...@googlemail.com>
> Just tried that - and got the same error message.
>
> Regards,
> Michael
> 2008/11/27 David Weintraub <qa...@gmail.com>
>
>> What if you do an "svn update" before you do your copy?
>> --
>> David Weintraub
>> qazwart@gmail.com
>
>
Re: Error when creating tags from working copy
Posted by Michael Susser <hd...@googlemail.com>.
Just tried that - and got the same error message.
Regards,
Michael
2008/11/27 David Weintraub <qa...@gmail.com>
> What if you do an "svn update" before you do your copy?
> --
> David Weintraub
> qazwart@gmail.com
Re: Error when creating tags from working copy
Posted by David Weintraub <qa...@gmail.com>.
What if you do an "svn update" before you do your copy?
--
David Weintraub
qazwart@gmail.com
On Thu, Nov 27, 2008 at 2:43 AM, Michael Susser <hd...@googlemail.com>wrote:
> I have read that Karl has retired ;-) Is there anybody else who can help
> me?
>
> Regards,
> Michael
>
>
> 2008/10/26 Karl Fogel <kf...@red-bean.com>
>
> "Michael Susser" <hd...@googlemail.com> writes:
>> > do you have any news?
>>
>> Not yet, but I've been traveling for more than a week now and haven't
>> had time to dig further yet. I will post here as soon as I know more.
>>
>> -Karl
>>
>> > Greetings,
>> > Michael
>> >
>> > 2008/10/12 Karl Fogel <kf...@red-bean.com>
>> >
>> > This is a deep one. I'm posting what I've learned so far in case
>> anyone
>> > has any hunches. On the client, the problem is that in
>> >
>> > libsvn_ra_neon/commit.c:commit_add_file()
>> >
>> > the following code should get a "file not found" error (i.e., an
>> HTTP
>> > 404) when it probes for the existence of the file we're about to
>> add,
>> > but doesn't -- instead, it's as though the file already exists:
>> >
>> > svn_ra_neon__resource_t *res;
>> > svn_error_t *err = svn_ra_neon__get_starting_props(&res,
>> >
>> file->cc->ras,
>> >
>> file->rsrc->wr_url,
>> > NULL,
>> workpool);
>> > if (!err)
>> > {
>> > /* If the PROPFIND succeeds the file already exists */
>> > return svn_error_createf(SVN_ERR_RA_DAV_ALREADY_EXISTS,
>> NULL,
>> > _("File '%s' already exists"),
>> > file->rsrc->url);
>> > }
>> >
>> > Here's what happens on the server side. Let's shortcut directly to
>> > mod_dav_svn/repos.c:get_resource(). Before the call to
>> > prep_resource()...
>> >
>> > /* prepare the resource for operation */
>> > if ((err = prep_resource(comb)) != NULL)
>> > return err;
>> >
>> > ...comb->exists is 0, as we would want (so is comb->res.exists, for
>> that
>> > matter). But after prep_resource(), comb->exists is 1!
>> >
>> > prep_resource() is just a dispatch function; the real stuff happens
>> in
>> > prep_working() (because comb->res.type ==
>> DAV_RESOURCE_TYPE_WORKING).
>> > In prep_working(), we get all the way to this code near the end:
>> >
>> > derr = fs_check_path(&kind, comb->priv.root.root,
>> > comb->priv.repos_path, pool);
>> >
>> > if (derr != NULL)
>> > return derr;
>> >
>> > comb->res.exists = (kind == svn_node_none) ? FALSE : TRUE;
>> > comb->res.collection = (kind == svn_node_dir) ? TRUE : FALSE;
>> >
>> > So that's where comb->res.exists gets set to 1. (I'm not sure where
>> > comb->exists gets set to 1, which might be important, but see
>> below.)
>> >
>> > Anyway, that call to fs_check_path() sets kind to svn_node_file,
>> even
>> > though the file shouldn't be present in this txn yet (that's why
>> we're
>> > adding it).
>> >
>> > Tracing fs_check_path --> svn_fs_fs__check_path() --> node_kind()
>> -->
>> > fs_node_id() --> get_dag() --> open_path() -->
>> svn_fs_fs__dag_open(),
>> > shows that, somehow, the file is actually there, according to the
>> FS.
>> > (It does not appear to be a dag node caching problem; the node isn't
>> > found in the cache, instead we find it the old-fashioned way, right
>> > there in the filesystem.)
>> >
>> > Back up in
>> http-2.2.9/modules/dav/main/mod_dav.c:dav_method_propfind(),
>> > this all matters because of this code:
>> >
>> > /* Ask repository module to resolve the resource */
>> > err = dav_get_resource(r, 1 /* label_allowed */, 0 /*
>> use_checked_in */,
>> > &resource);
>> > if (err != NULL)
>> > return dav_handle_err(r, err, NULL);
>> >
>> > if (dav_get_resource_state(r, resource) == DAV_RESOURCE_NULL) {
>> > /* Apache will supply a default error for this. */
>> > return HTTP_NOT_FOUND;
>> > }
>> >
>> > Not only does dav_get_resource() not get an error, but the call to
>> > dav_get_resource_state() will not return DAV_RESOURCE_NULL, because
>> that
>> > code (in httpd-2.2.9/modules/dav/main/util_lock.c) says:
>> >
>> > if (resource->exists)
>> > return DAV_RESOURCE_EXISTS;
>> >
>> > Boom. If it weren't for that, the function would return
>> > DAV_RESOURCE_NULL and we'd be fine.
>> >
>> > Note that in the reproduction recipe, if you insert an "svn up
>> Data/wc"
>> > right before the final svn cp in the reproduction recipe, then none
>> of
>> > this weirdness happens, and the bug doesn't reproduce.
>> >
>> > So why does the file claim to be present in the txn already? And
>> why
>> > does updating the whole working copy to r2 (instead of having a
>> mixed
>> > r1/r2 working copy) cause the repository filesystem to correctly
>> answer
>> > that the file is not there?
>> >
>> > I don't know. I will continue to debug, but if anyone has any
>> inspired
>> > ideas, please post.
>> >
>> > -Karl
>> >
>> > Karl Fogel <kf...@red-bean.com> writes:
>> > > "Michael Susser" <hd...@googlemail.com> writes:
>> > >> i have found a bug when creating tags from working copy in svn
>> 1.5.2
>> > >> (and also 1.5.3). Here is a recipe how to reproduce the error:
>> (my
>> > >> apache is configured to host the repositories in E:\SVNRep)
>> > >>
>> > >> [...]
>> > >>
>> > >> svn copy -m"tagging" E:\Data\wc\trunk
>> http://myserver/svn/repo/tags/
>> > V1.0.0
>> > >>>svn: Commit failed (details follow):
>> > >>>svn: File '/svn/repo/tags/V1.0.0/dir/file.cpp' already exists
>> > >
>> > > Thank you for the excellent recipe. I can reproduce this, and
>> have
>> > > written a Unix Bourne shell reproduction script (see below). Note
>> that
>> > > this only reproduces over http://. If you try it with svn:// or
>> > > file://, the tagging works fine.
>> > >
>> > >> This error message is absolutely wrong! I investigated what went
>> wrong
>> > and
>> > >> found the following: after the commit action the working copy is
>> not
>> > updated
>> > >> correctly(?). The changed file "file.cpp" gets a new revision
>> (2), but
>> > its
>> > >> parent directory "dir" stays at revision 1. Is this ok?
>> > >
>> > > Well, that part is okay. When you commit, only the committed
>> items get
>> > > their revisions bumped locally -- in other words, a commit does
>> not do
>> > > an update on the items that are not part of the commit. However,
>> > > Subversion is supposed to transparently handle the resultant mixed
>> > > revisions. They shouldn't matter here.
>> > >
>> > > This bug seems familiar, like we've either fixed it before or
>> filed an
>> > > issue for it. I'll check the logs and the issue tracker. But we
>> have a
>> > > reproduction recipe, so that means we can fix it or re-fix it :-).
>> > >
>> > >
>> >
>> ----------------------------------------------------------------------------
>> > > #!/bin/sh
>> > >
>> > > # The next line is the only line you should need to adjust.
>> > > SVNDIR=/home/kfogel/src/subversion
>> > >
>> > > SVN=${SVNDIR}/subversion/svn/svn
>> > > SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
>> > > SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin
>> > >
>> > > # Select an access method. If svn://, the svnserve setup is
>> > > # handled automagically by this script; but if http://, then
>> > > # you'll have to configure it yourself first.
>> > > #
>> > > URL=http://localhost/ms/repos
>> > > # URL=svn://localhost/repos
>> > > # URL=file:///`pwd`/repos
>> > >
>> > > rm -rf repos wc Data import-me
>> > >
>> > > ${SVNADMIN} create repos
>> > >
>> > > # These are for svnserve only.
>> > > echo "[general]" > repos/conf/svnserve.conf
>> > > echo "anon-access = write" >> repos/conf/svnserve.conf
>> > > echo "auth-access = write" >> repos/conf/svnserve.conf
>> > >
>> > > # The server will only be contacted if $URL is svn://foo, of
>> course.
>> > > ${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
>> > > # And put the kill command in a file, in case need to run it
>> manually.
>> > > echo "kill -9 `cat svnserve-pid`" > k
>> > > chmod a+rwx k
>> > >
>> > > mkdir Data
>> > > svn co ${URL} Data/wc
>> > > mkdir Data/wc/tags
>> > > mkdir Data/wc/trunk
>> > > mkdir Data/wc/trunk/dir
>> > > cp /dev/null Data/wc/trunk/dir/file.cpp
>> > > ${SVN} add Data/wc/t*
>> > > ${SVN} ci -m"test" Data/wc
>> > >
>> > > echo "ABC" >> Data/wc/trunk/dir/file.cpp
>> > >
>> > > ${SVN} ci -m"test" Data/wc
>> > >
>> > > # Using http:// only, the next command fails with this error:
>> > > #
>> > > # subversion/libsvn_client/copy.c:1319: (apr_err=175005)
>> > > # svn: Commit failed (details follow):
>> > > # subversion/libsvn_ra_neon/commit.c:1036: (apr_err=175005)
>> > > # svn: File '/ms/repos/tags/V1.0.0/dir/file.cpp' already exists
>> > > #
>> > > ${SVN} copy -m"tagging" Data/wc/trunk ${URL}/tags/V1.0.0
>> > >
>> > > ./k
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> > For additional commands, e-mail: users-help@subversion.tigris.org
>>
>
>
Re: Error when creating tags from working copy
Posted by Karl Fogel <kf...@red-bean.com>.
"Michael Susser" <hd...@googlemail.com> writes:
> I have read that Karl has retired ;-) Is there anybody else who can help me?
:-) Heh, sorry, yeah. I'm in read-only mode on this and other threads.
I hope someone can finish the bug; I won't be able to work on it, but
I'm watching hopefully.
-Karl
> 2008/10/26 Karl Fogel <kf...@red-bean.com>
>
> "Michael Susser" <hd...@googlemail.com> writes:
> > do you have any news?
>
> Not yet, but I've been traveling for more than a week now and haven't
> had time to dig further yet. I will post here as soon as I know more.
>
> -Karl
>
> > Greetings,
> > Michael
> >
> > 2008/10/12 Karl Fogel <kf...@red-bean.com>
> >
> > This is a deep one. I'm posting what I've learned so far in case
> anyone
> > has any hunches. On the client, the problem is that in
> >
> > libsvn_ra_neon/commit.c:commit_add_file()
> >
> > the following code should get a "file not found" error (i.e., an HTTP
> > 404) when it probes for the existence of the file we're about to add,
> > but doesn't -- instead, it's as though the file already exists:
> >
> > svn_ra_neon__resource_t *res;
> > svn_error_t *err = svn_ra_neon__get_starting_props(&res,
> > file->cc->
> ras,
> > file->rsrc->
> wr_url,
> > NULL,
> workpool);
> > if (!err)
> > {
> > /* If the PROPFIND succeeds the file already exists */
> > return svn_error_createf(SVN_ERR_RA_DAV_ALREADY_EXISTS,
> NULL,
> > _("File '%s' already exists"),
> > file->rsrc->url);
> > }
> >
> > Here's what happens on the server side. Let's shortcut directly to
> > mod_dav_svn/repos.c:get_resource(). Before the call to
> > prep_resource()...
> >
> > /* prepare the resource for operation */
> > if ((err = prep_resource(comb)) != NULL)
> > return err;
> >
> > ...comb->exists is 0, as we would want (so is comb->res.exists, for
> that
> > matter). But after prep_resource(), comb->exists is 1!
> >
> > prep_resource() is just a dispatch function; the real stuff happens
> in
> > prep_working() (because comb->res.type == DAV_RESOURCE_TYPE_WORKING).
> > In prep_working(), we get all the way to this code near the end:
> >
> > derr = fs_check_path(&kind, comb->priv.root.root,
> > comb->priv.repos_path, pool);
> >
> > if (derr != NULL)
> > return derr;
> >
> > comb->res.exists = (kind == svn_node_none) ? FALSE : TRUE;
> > comb->res.collection = (kind == svn_node_dir) ? TRUE : FALSE;
> >
> > So that's where comb->res.exists gets set to 1. (I'm not sure where
> > comb->exists gets set to 1, which might be important, but see below.)
> >
> > Anyway, that call to fs_check_path() sets kind to svn_node_file, even
> > though the file shouldn't be present in this txn yet (that's why
> we're
> > adding it).
> >
> > Tracing fs_check_path --> svn_fs_fs__check_path() --> node_kind() -->
> > fs_node_id() --> get_dag() --> open_path() --> svn_fs_fs__dag_open(),
> > shows that, somehow, the file is actually there, according to the FS.
> > (It does not appear to be a dag node caching problem; the node isn't
> > found in the cache, instead we find it the old-fashioned way, right
> > there in the filesystem.)
> >
> > Back up in http-2.2.9/modules/dav/main/mod_dav.c:dav_method_propfind
> (),
> > this all matters because of this code:
> >
> > /* Ask repository module to resolve the resource */
> > err = dav_get_resource(r, 1 /* label_allowed */, 0 /*
> use_checked_in */,
> > &resource);
> > if (err != NULL)
> > return dav_handle_err(r, err, NULL);
> >
> > if (dav_get_resource_state(r, resource) == DAV_RESOURCE_NULL) {
> > /* Apache will supply a default error for this. */
> > return HTTP_NOT_FOUND;
> > }
> >
> > Not only does dav_get_resource() not get an error, but the call to
> > dav_get_resource_state() will not return DAV_RESOURCE_NULL, because
> that
> > code (in httpd-2.2.9/modules/dav/main/util_lock.c) says:
> >
> > if (resource->exists)
> > return DAV_RESOURCE_EXISTS;
> >
> > Boom. If it weren't for that, the function would return
> > DAV_RESOURCE_NULL and we'd be fine.
> >
> > Note that in the reproduction recipe, if you insert an "svn up Data/
> wc"
> > right before the final svn cp in the reproduction recipe, then none
> of
> > this weirdness happens, and the bug doesn't reproduce.
> >
> > So why does the file claim to be present in the txn already? And why
> > does updating the whole working copy to r2 (instead of having a mixed
> > r1/r2 working copy) cause the repository filesystem to correctly
> answer
> > that the file is not there?
> >
> > I don't know. I will continue to debug, but if anyone has any
> inspired
> > ideas, please post.
> >
> > -Karl
> >
> > Karl Fogel <kf...@red-bean.com> writes:
> > > "Michael Susser" <hd...@googlemail.com> writes:
> > >> i have found a bug when creating tags from working copy in svn
> 1.5.2
> > >> (and also 1.5.3). Here is a recipe how to reproduce the error: (my
> > >> apache is configured to host the repositories in E:\SVNRep)
> > >>
> > >> [...]
> > >>
> > >> svn copy -m"tagging" E:\Data\wc\trunk http://myserver/svn/repo/
> tags/
> > V1.0.0
> > >>>svn: Commit failed (details follow):
> > >>>svn: File '/svn/repo/tags/V1.0.0/dir/file.cpp' already exists
> > >
> > > Thank you for the excellent recipe. I can reproduce this, and have
> > > written a Unix Bourne shell reproduction script (see below). Note
> that
> > > this only reproduces over http://. If you try it with svn:// or
> > > file://, the tagging works fine.
> > >
> > >> This error message is absolutely wrong! I investigated what went
> wrong
> > and
> > >> found the following: after the commit action the working copy is
> not
> > updated
> > >> correctly(?). The changed file "file.cpp" gets a new revision (2),
> but
> > its
> > >> parent directory "dir" stays at revision 1. Is this ok?
> > >
> > > Well, that part is okay. When you commit, only the committed items
> get
> > > their revisions bumped locally -- in other words, a commit does not
> do
> > > an update on the items that are not part of the commit. However,
> > > Subversion is supposed to transparently handle the resultant mixed
> > > revisions. They shouldn't matter here.
> > >
> > > This bug seems familiar, like we've either fixed it before or filed
> an
> > > issue for it. I'll check the logs and the issue tracker. But we
> have a
> > > reproduction recipe, so that means we can fix it or re-fix it :-).
> > >
> > >
> >
> ----------------------------------------------------------------------------
> > > #!/bin/sh
> > >
> > > # The next line is the only line you should need to adjust.
> > > SVNDIR=/home/kfogel/src/subversion
> > >
> > > SVN=${SVNDIR}/subversion/svn/svn
> > > SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
> > > SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin
> > >
> > > # Select an access method. If svn://, the svnserve setup is
> > > # handled automagically by this script; but if http://, then
> > > # you'll have to configure it yourself first.
> > > #
> > > URL=http://localhost/ms/repos
> > > # URL=svn://localhost/repos
> > > # URL=file:///`pwd`/repos
> > >
> > > rm -rf repos wc Data import-me
> > >
> > > ${SVNADMIN} create repos
> > >
> > > # These are for svnserve only.
> > > echo "[general]" > repos/conf/svnserve.conf
> > > echo "anon-access = write" >> repos/conf/svnserve.conf
> > > echo "auth-access = write" >> repos/conf/svnserve.conf
> > >
> > > # The server will only be contacted if $URL is svn://foo, of
> course.
> > > ${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
> > > # And put the kill command in a file, in case need to run it
> manually.
> > > echo "kill -9 `cat svnserve-pid`" > k
> > > chmod a+rwx k
> > >
> > > mkdir Data
> > > svn co ${URL} Data/wc
> > > mkdir Data/wc/tags
> > > mkdir Data/wc/trunk
> > > mkdir Data/wc/trunk/dir
> > > cp /dev/null Data/wc/trunk/dir/file.cpp
> > > ${SVN} add Data/wc/t*
> > > ${SVN} ci -m"test" Data/wc
> > >
> > > echo "ABC" >> Data/wc/trunk/dir/file.cpp
> > >
> > > ${SVN} ci -m"test" Data/wc
> > >
> > > # Using http:// only, the next command fails with this error:
> > > #
> > > # subversion/libsvn_client/copy.c:1319: (apr_err=175005)
> > > # svn: Commit failed (details follow):
> > > # subversion/libsvn_ra_neon/commit.c:1036: (apr_err=175005)
> > > # svn: File '/ms/repos/tags/V1.0.0/dir/file.cpp' already exists
> > > #
> > > ${SVN} copy -m"tagging" Data/wc/trunk ${URL}/tags/V1.0.0
> > >
> > > ./k
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org