Best way to check if a directory is an brz branch
John Arbash Meinel
john at arbash-meinel.com
Tue Feb 17 17:36:26 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
...
>
> I could change BranchEmailer to take a branch as an argument and not its
> path I suppose. This is not a change I want to do because I think it
> makes more sense how it is now.
Perhaps, though I think BranchEmailer is just going to open them up
later anyway.
However, for your initial issue, there is:
bzrlib.bzrdir.BzrDir.find_branches(transport)
I would guess that actually returns real Branch objects, but it does all
the walking for you.
>
> But it's also easy to think of uses for such a function. Imagine a
> plugin that lists all branches below a directory recursively printing
> them to the terminal. It does not need to open any of these branches in
> order to do so. It just needs to print their paths.
>
> Cheers,
>
> Nick
'bzr branches' (from bzrtools) already does that.
To know if it is a real branch or not you pretty much need to do all the
work to open it. So why not open it?
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkma9ZoACgkQJdeBCYSNAAMeCwCfTHineUozddqGTLdzZZSdhmdV
qNgAnjuEGa5mnxpJz9VB/xBoQoLeTwdQ
=9izE
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list