BzrDir.has_{branch,workingtree}

Jelmer Vernooij jelmer at samba.org
Mon Mar 22 22:01:32 GMT 2010


On 03/22/10 15:59, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jelmer Vernooij wrote:
>    
>> BzrDir has two methods that just check whether a branch or working tree
>> are present. Their docstrings already mention that using them is
>> probably a bad idea - if you need a Branch you should just try to open
>> it and deal with any exceptions that occur, rather than checking first
>> if the branch is present.
>>
>> There are only two users of has_branch() in the Bazaar codebase, but
>> they could easily be removed. Does anybody object to it being removed?
>>
>> Cheers,
>>
>> Jelmer
>>      
> seems fine to me. We've generally moved away from 'has' checking.
> However, what is the code that is using it?
>    
There was just one actually - "bzr init" uses it to check if there's a 
branch present before calling controldir.create_branch().

Cheers,

Jelmer



More information about the bazaar mailing list