[PATCH] osutils.rmtree + test

John A Meinel john at arbash-meinel.com
Mon Jan 23 05:29:37 GMT 2006


Aaron Bentley wrote:
> John A Meinel wrote:
> | Alexander Belchenko wrote:
> |
> |>Aaron Bentley пишет:
> |>>This is a good start, but I think we can go further; I think we should
> |>>provide an "always-works" version of rmtree in osutils, and start using
> |>>it everywhere.
> |
> |
> | I'm not 100% that we want 'always-works'. I know we switched from having
> | branch entries being readonly so we could let people do 'rm -r' and not
> | have to use '-f'. I also don't want us to suppress other errors because
> | we always delete everything.
> 
> Okay, I don't mean *always*, and that's not what Alexander implemented,
> anyhow.  The ideas is that on Windows, it should succeed in the same
> places where it succeeds on POSIX.  That way, we won't get gratuitous
> Windows incompatibilities in the future.
> 
> Specifically, we're looking at the readonly flag, which under Windows
> will prevent a file from being deleted.  This version of rmtree just
> handles the case where a deletion failed because the file was marked
> readonly.
> 
> | I just want this discussed a little bit before I give full approval.
> 
> Does that address your concerns, or is there more?

I had pretty much worked myself through it. Looking at the locations
doesn't seem like we do anything foolish with rmtree anyway. And since
this is just a 'make win32 act like posix', I'm okay with it.

+1 to Alexander's changes.

> 
> | I think we need to figure out what this test should be doing, rather
> | than putting up with the print statement, and commented out code. I
> | don't expect Alexander to do this, but what is really going on with this
> | test?
> 
> The test made sure that bzr pull --basis was working properly, by
> deleting the stores that pull should not be using.  If it was broken, it
> would try to use the stores, and fail.
> 
> Robert Collins disabled the test, added the annoying text, got me to
> explain how it was supposed to work, and then didn't fix it.
> 
> Aaron

Can we fix this? Just re-enable the rmtree (only now deleting
.bzr/weaves and .bzr/revision-store, not .bzr/inventory-store).

We can add a comment to make sure it isn't confusing how it should be fixed.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060122/5c904e89/attachment.pgp 


More information about the bazaar mailing list