NoRepositoryPresent exception raised on symbolic link to branch

Bug #194141 reported by Daniel Schierbeck
0
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned
Bazaar/Avahi Plugin
New
Undecided
Unassigned

Bug Description

I have a symbolic link at ~/.bazaar/plugins/gtk pointing to ~/Projects/bzr-gtk/main, which is also a symbolic link which I change often to point to the branch of bzr-gtk I'm working on.

When bzr-avahi is installed, running bzr serve spits out this traceback:

  File "/home/daniel/.bazaar/plugins/avahi/advertise.py", line 270, in callback
    _function(*args, **kwargs)
  File "/home/daniel/.bazaar/plugins/avahi/advertise.py", line 289, in add_server
    server.scan_branches()
  File "/home/daniel/.bazaar/plugins/avahi/advertise.py", line 68, in scan_branches
    for branch in BzrDir.find_branches(trans):
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 314, in find_branches
    for branch, repo in BzrDir.find_bzrdirs(transport, evaluate=evaluate):
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 279, in find_bzrdirs
    recurse, value = evaluate(bzrdir)
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 308, in evaluate
    branch = bzrdir.open_branch()
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 1348, in open_branch
    return format.open(self, _found=True)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1185, in open
    _repository=a_bzrdir.find_repository())
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 530, in find_repository
    raise errors.NoRepositoryPresent(self)
bzrlib.errors.NoRepositoryPresent: No repository present: "file:///home/daniel/.bazaar/plugins/gtk/"

It seems as if the symlinks aren't followed, although I haven't looked at the code, and as such cannot be sure.

description: updated
description: updated
Revision history for this message
James Henstridge (jamesh) wrote :

Are you trying to share your entire home directory? If so, I'd recommend against that since it is giving read only access to everything in your home dir to the world (including SSH and PGP private keys).

As for the error itself, bzr-avahi is using the standard bzrlib.find_bzrdirs() API. I think it should probably be ignoring branches that raise NoRepositoryPresent rather than barfing like this.

Revision history for this message
Daniel Schierbeck (dasch) wrote :

I'm not really sharing my home directory, I was just playing around, and discovered the bug :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.