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

Re: "svn update" fails to remove folder that still contains ignored files

From: Daniel Becroft <djcbecroft_at_gmail.com>
Date: Mon, 23 Nov 2009 06:40:51 +1000

On Fri, Nov 20, 2009 at 11:55 PM, Markus Kuhn <Markus.Kuhn_at_cl.cam.ac.uk> wrote:
> I'm not sure whether this is a bug report or a feature request:
>
> Very sensibly, "svn update" does not remove any folder that still
> contain files that are not under version control. However, I was
> surprised to find out that this even applies to *ignored* files.
>
> Shouldn't svn update be at liberty to destroy any ignored files located
> in a folder that it is about to remove?

My first response to this is: no. SVN should only be at liberty to
destroy files that are either (a) under it's control; or (b) explicity
requested by the user. Neither applies in this case.

> Aren't ignored files those that are by definition unimportant or easily
> remade?

No. Ignored files are, by definition, files which are not to be under
version control (by default - ignored files can still be forced under
version control).

> The following shell lines demonstrate this (to me) unexpected behaviour:
>
> # Test whether svn update deletes ignored files correctly before
> # removing a directory -- Markus Kuhn -- 2009-11-20
> #
> # This test fails on svn 1.5.7 under Linux :-(
> #
> # paths used
> repos=`pwd`/testrepos
> url=file://$repos
> workdir=testwd
> #
> # create a repository containing folder a/ and check it out
> svnadmin create $repos
> svn mkdir -m '' $url/a
> svn co $url $workdir
> # create in $workdir a file a/ignoreme and add it to svn:ignore
> touch $workdir/a/ignoreme
> touch $workdir/a/ignoreme~
> svn status $workdir/a
> svn propset svn:ignore ignoreme $workdir/a
> svn commit -m '' $workdir
> # test that it is ignored now
> svn status $workdir/a
> # now remove a/ and test whether ignoreme gets removed as well
> svn rm -m '' $url/a
> svn update $workdir
> echo Expected result: the directory $workdir/a should now have disappeared:
> ls -laR $workdir/a
> [ -e $workdir/a ] && echo "FAILED: svn update didn't remove $workdir/a/ignoreme"
> [ -e $workdir/a ] || echo "SUCCESS: svn update behaved as it should"
> rm -rf $repos $workdir  # cleanup
>
> Desired behaviour: the presence of ignored files in a folder should not
> keep "svn update" from removing that folder (unless the user asks
> explicitely with "svn update --no-ignore" not to ignore such files).
>
> Any views on the suggested behaviour or suggestions how to achieve it?

I would have expected SVN to raise a conflict (maybe it should even be
a tree conflict) when attempting the update. The directory /a that is
trying to be deleted during the update is in a 'non-pristine' state
(ie not identical to BASE). I would expect the same behavior to occur
if the folder contained unversioned (but not-ignored) files as well.

Regards,
Daniel B.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2423108

Please start new threads on the <users_at_subversion.apache.org> mailing list.
To subscribe to the new list, send an empty e-mail to <users-subscribe_at_subversion.apache.org>.
Received on 2009-11-22 21:42:42 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.