You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Martin Furter <mf...@rola.ch> on 2006/08/18 16:13:30 UTC

delete dir shows deleted files

Hello

Today I moved some files around and deleted the dir which contained the 
files.  Deleting the directory showed the deleted files inside again as 
deleted.  I'd have expected them to not show up again.

Is this a bug ?

Martin


Output of the reproduction recipe (tested with svn trunk r21026):

status before delete dir

D      a/file2.txt
D      a/file1.txt
A  +   b/file2.txt

delete dir

D         a/file2.txt
D         a/file1.txt
D         a


Reproduction recipe:
#!/bin/sh

# initialize:
# create repos and wc, then add the following tree:
#  a/
#  a/file1.txt
#  a/file2.txt
#  b/
svnadmin create repos
svn co file://$PWD/repos wc
cd wc
svn mkdir a
svn mkdir b
echo "hello" > a/file1.txt
svn add a/file1.txt
echo "hello" > a/file2.txt
svn add a/file2.txt
svn ci -m "initialize"

# do a delete and a move
echo ""
echo "delete and move"
echo ""
svn rm a/file1.txt
svn mv a/file2.txt b

# show status
echo ""
echo "status before delete dir"
echo ""
svn st

# now delete the dir a
echo ""
echo "delete dir"
echo ""
svn rm a

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

Re: delete dir shows deleted files

Posted by Martin Furter <mf...@rola.ch>.

On Fri, 18 Aug 2006, Brad Kittenbrink wrote:

>
> Martin Furter wrote:
>> 
>> Hello
>> 
>> Today I moved some files around and deleted the dir which contained the 
>> files.  Deleting the directory showed the deleted files inside again as 
>> deleted.  I'd have expected them to not show up again.
>> 
>> Is this a bug ?
>> 
>> Martin
>> 
>> 
>
> I am not a subversion developer, but I don't think so.  Deleting directories 
> shows all files in the directory as deleted. It is independent of whether or 
> not you deleted them before.  I think this is intentional to provide extra 
> safety to prevent you from not noticing when you're deleting things.  For 
> example, compare this modified version of your script:
>
> -Brad

Yes, right.

But that's not what I'm complaining about. I also like that it shows which 
files it deletes. What I was wondering is why it is able to delete a file 
twice.

Your version of the script shows the following output:

status before delete dir

D      a/file2.txt
D      a/file1.txt
A  +   b/file2.txt

delete dir

D         a/file2.txt
D         a/file3.txt
D         a/file1.txt
D         a

But file1.txt and file2.txt were already deleted so I would not expect 
them to show up when deletting the directory.

If I do the same thing with Unix commands i get the following output:

> mkdir a
> touch a/file1.txt a/file2.txt a/file3.txt
> rm -vf a/file1.txt
removed `a/file1.txt'
> rm -vf a/file2.txt
removed `a/file2.txt'
> rm -vrf a
removed `a/file3.txt'
removed directory: `a'

Here the delete of the directory shows only the remaining files, the 
deleted files don't show up anymore.

Shouldn't subversion do the same thing ?

Martin

> #!/bin/sh
>
> # initialize:
> # create repos and wc, then add the following tree:
> #  a/
> #  a/file1.txt
> #  a/file2.txt
> #  b/
> svnadmin create repos
> svn co file://$PWD/repos wc
> cd wc
> svn mkdir a
> svn mkdir b
> echo "hello" > a/file1.txt
> svn add a/file1.txt
> echo "hello" > a/file2.txt
> svn add a/file2.txt
> echo "hello" > a/file3.txt
> svn add a/file3.txt
> svn ci -m "initialize"
>
> # do a delete and a move
> echo ""
> echo "delete and move"
> echo ""
> svn rm a/file1.txt
> svn mv a/file2.txt b
>
> # show status
> echo ""
> echo "status before delete dir"
> echo ""
> svn st
>
> # now delete the dir a
> echo ""
> echo "delete dir"
> echo ""
> svn rm a
>
> # show status
> echo ""
> echo "status after delete dir"
> echo ""
> svn st
>
>
>
> ---------------------------------------------------------------------
> 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: delete dir shows deleted files

Posted by Brad Kittenbrink <br...@windwardmark.net>.
Martin Furter wrote:
>
> Hello
>
> Today I moved some files around and deleted the dir which contained 
> the files.  Deleting the directory showed the deleted files inside 
> again as deleted.  I'd have expected them to not show up again.
>
> Is this a bug ?
>
> Martin
>
>

I am not a subversion developer, but I don't think so.  Deleting 
directories shows all files in the directory as deleted. It is 
independent of whether or not you deleted them before.  I think this is 
intentional to provide extra safety to prevent you from not noticing 
when you're deleting things.  For example, compare this modified version 
of your script:

-Brad


#!/bin/sh

# initialize:
# create repos and wc, then add the following tree:
#  a/
#  a/file1.txt
#  a/file2.txt
#  b/
svnadmin create repos
svn co file://$PWD/repos wc
cd wc
svn mkdir a
svn mkdir b
echo "hello" > a/file1.txt
svn add a/file1.txt
echo "hello" > a/file2.txt
svn add a/file2.txt
echo "hello" > a/file3.txt
svn add a/file3.txt
svn ci -m "initialize"

# do a delete and a move
echo ""
echo "delete and move"
echo ""
svn rm a/file1.txt
svn mv a/file2.txt b

# show status
echo ""
echo "status before delete dir"
echo ""
svn st

# now delete the dir a
echo ""
echo "delete dir"
echo ""
svn rm a

# show status
echo ""
echo "status after delete dir"
echo ""
svn st



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