[MERGE] WorkingTree.unversion

Robert Collins robertc at robertcollins.net
Thu Sep 7 22:59:09 BST 2006


On Thu, 2006-09-07 at 13:38 -0500, John Arbash Meinel wrote:
> Robert Collins wrote:
> > This adds an unversion API to working tree which unversions entries by
> > id.
> > 
> > When given an id, all the children of the id are unversioned too.
> > 
> > -Rob
> > 
> 
> ...
> 
> > +class NoSuchId(BzrNewError):
> > +    """The file id %(file_id)s is not present in the tree %(tree)s."""
> > +    
> > +    def __init__(self, tree, file_id):
> > +        BzrNewError.__init__(self)
> > +        self.file_id = file_id
> > +        self.tree = tree
> 
> I tend to do this as:
> def __init__(self, tree, file_id):
>     BzrNewError.__init__(self, file_id=file_id, tree=tree)
> 
> Since it is a little bit shorter. I don't know that we have a
> preference, but since I saw the difference we may as well discuss it.

All the others that I know of are the explicit multi-line version.

I dont like that abuse of kwargs to set value, for some reason I thought
it had been removed in BzrNewError.


> ...
> 
> v- I thought PEP8 said
> while to_find_delete:
> 
> was preferable to:
> while len(to_find_delete):

I was remembering a discussion we had about clarity a few weeks back.
Personally I prefer 
while to_find_delete:

so - very happy to change if you agree that that is fine.

> Also, I think Aaron made a good point that remove_recursive() might be a
> better name.

Hes also expressed a desire for a entry based call, so about about
calling this one
remove_recursive_id.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060908/1f5f2936/attachment.pgp 


More information about the bazaar mailing list