bug? find_branches or find_bzrdir tries to open all files as bzr locations

Aaron Bentley aaron at aaronbentley.com
Tue May 17 20:53:59 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11-05-16 04:48 AM, Alexander Belchenko wrote:
> Aaron, I think your answers imply that you have talked only about remote
> branches/remote servers/smart servers.

I use EAFP for all my local filesytem operations, too.

> While I'm mostly concerned about local usage.
> 
> `bzr qlog` without any parameters run inside shared repository is trying
> to detect all available branches and show log for all of them. And often
> it has very slow start with many branches with many files.
> 
> So, I think it could perform better for local filesystem if it will skip
> plain files. Perhaps symlinks should be inspected as well as
> directories, I don't know.

I'm going to assume two things:
1. when we list files, we don't get their filetype
2. statting a file to determine its filetype takes roughly the same
amount of time as a failed attempt to open ".bzr/branch-format" where
".bzr" is a file.

If those assumptions are true, the fastest thing we can do is attempt to
open .bzr/branch-format.  Testing the filetype would introduce and extra
filesystem call, which would be slower.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3S4GYACgkQ0F+nu1YWqI0RIgCeIAA6BkSME2mheZNMOTe5cLp7
XdMAn1+VKgimTJOvx/YKDH2B//9NjGd0
=1R5J
-----END PGP SIGNATURE-----



More information about the bazaar mailing list