inaccessible shared repositories

Aaron Bentley aaron.bentley at utoronto.ca
Mon Dec 4 17:16:23 GMT 2006


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

Kent Gibson wrote:
> I ran across a small wrinkle wrt shared repositories.
> 'bzr branch' goes looking for a containing shared repository before
> deciding whether to create a new one.  To find a containing shared
> repository, bzr walks up the path until it finds one.
> If the one it finds it not accessible (e.g. it is owned by someone
> else) then bzr reports:
> 
> bzr: ERROR: Permission denied: u'/.bzr/branch-format': [Errno 13]
> Permission denied: u'/.bzr/branch-format'

The fact that this is displayed this way is IMHO very wrong.  System
errors should be considered internal errors and produce a traceback.

So if there's a permission failure opening a repository it should raise
a bzr-specific error.

> (In my case I have a bzr repository in / that is owned by root and not
> accessible to other users - chmod 700.)
> 
> The only workaround I can find is to first create my own repository
> using 'bzr init-repo' and then add the branch to that.
> That seems a bit heavyweight, so I would prefer that bzr consider a
> .bzr directory it cannot access as not being a valid repository and
> remove it from consideration.

I think this is an area where reasonable users might disagree.  For example:

"/var/dev/group-repo" is a shared repository accessible to all users in
the group "developers"
"jrandom" is a new developer in the company.  He has accidentally not
been added to the "developers" group.
jrandom tries to add a branch to /var/dev/group-repo/jrandom.  It is
silently added as a standalone branch instead.

So I think at minimum, we should warn if the containing repository is
not usable due to a permission issue.  We could error, but it's pretty
easy to recover from, so maybe that's all we should do.

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

iD8DBQFFdFfn0F+nu1YWqI0RApwIAJ4ktcrmSidZrQbahn35YTZiFfau1wCfU4qI
+jACTsKHAbZW2B4DzO1YAXE=
=RtbL
-----END PGP SIGNATURE-----




More information about the bazaar mailing list