Occasional AttributeError from Tree.get_file_by_path

Michael Gliwinski Michael.Gliwinski at henderson-group.com
Tue Oct 26 15:06:10 BST 2010


On Tuesday 26 Oct 2010 14:04:23 John Arbash Meinel wrote:
> ...
> 
> > OK, I'll report it and submit a fix.  Tree does have path2id, however I'm
> > getting lost here as all it does is:
> > 
> > return self._inventory.path2id(path)
> > 
> > the only difference is that path2id is decorated with @needs_read_lock
> > 
> > Still, if you agree this is right, I'll just do that.
> 
> It is correct. WorkingTree.path2id has a custom implementation. (If not
> WT, then WT4 does.)

Ah, yes indeed WT4 does.

> >> Also, WT.get_file_by_path should really be special cased, because it
> >> easily thinks in terms of path. The only question is whether the command
> >> should fail if the file isn't versioned...
> > 
> > ATM it will fail as path2id will return None and get_file(None) throws an
> > error.  Do you mean in case of a WorkingTree it shouldn't fail?
> 
> It is an open question about what it *should* do. :)

OK, I see the dilemma here.  Unless someone has a preference I'm going to 
leave it as is for now as it is not directly related to the bug anyway.

Thanks for the tips John!


-- 
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319

**********************************************************************************************
The information in this email is confidential and may be legally privileged.  It is intended solely for the addressee and access to the email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed  in the governing client engagement leter or contract.
If you have received this email in error please notify support at henderson-group.com

John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
*********************************************************************************




More information about the bazaar mailing list