bzr serve should warn if (implied) directory is not a repository

Bug #98516 reported by Ian Clatworthy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Low
Unassigned

Bug Description

If I'm inside a shared repository but not at the root of it, I can run bsr serve but it won't do anything useful. It ought to want about the directory not being a repository. Alternatively, it could infer the repository directory.

Tags: hpss serve chroot
Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 98516] bzr serve should warn if (implied) directory is not a repository

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

Ian Clatworthy wrote:
> Public bug reported:
>
> If I'm inside a shared repository but not at the root of it, I can run
> bsr serve but it won't do anything useful.

This seems wrong. You ought to be able to run bzr serve in a branch, to
serve only that branch.

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

iD8DBQFGC6Yj0F+nu1YWqI0RAmhSAJwIjuKnVPq7+83xnA7oL0/FKCumpQCeKA2f
aRG6ZxSgz704Ifbmw5wVcLk=
=ef0N
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote :

Well, if you are serving a branch that is part of a shared repository, until the "smarts" are smart enough, you won't be able to. (As long as we have VFS requests going for the .bzr/repository/* files, you need to be able to expose it).

I suppose there are a couple of possibilities. The smart server could just know "oh, you want .bzr/repository, that is actually over here, but I'll pretend it is where you want them". I don't really prefer that, though.

So until the smart server doesn't expose the filesystem at all (no vfs commands), I think it is reasonable to have it issue a warning when it is exposing branches that cannot be processed because their repository is not available within the chroot.

Revision history for this message
Andrew Bennetts (spiv) wrote :

I agree with John: once the smart server has enough smart verbs this will be solved properly, but until then we should try warn users of "bzr serve" when it's not going to do what they expect.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 98516] Re: bzr serve should warn if (implied) directory is not a repository

On 3/30/07, Andrew Bennetts <email address hidden> wrote:
> I agree with John: once the smart server has enough smart verbs this
> will be solved properly, but until then we should try warn users of "bzr
> serve" when it's not going to do what they expect.

I agree too.

One easy way to fix this may be: if we're trying to open the branch at
a url and we find a branch, but looking upwards we hit the root before
finding the repository, then we should maybe give a more specific
error. That will at least make it clear that there is a branch there,
but we couldn't open its repository.

Even after we don't need vfs access to the repository we need to
consider cases like

  cd trunk/bzrlib
  bzr serve

(can't do anything)

--
Martin

Changed in bzr:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

There still is no warning whatsoever from bzr serve that the directory it's serving can't, in fact, be served:

Term 1
 $ bzr init-repo bzr
Shared repository with trees (format: 2a)
Location:
  shared repository: bzr
 $ cd bzr
 $ bzr init trunk
Created a repository tree (format: 2a)
Using shared repository: /bzr/
 $ cd trunk
 $ cat > foo
lorem ipsum
^C
 $ bzr add
bzr adding foo
 $ bzr ci -m 'A commit'
Committing to:/bzr/trunk/
added foo
Committed revision 1.
 $ cd ..
 $ bzr branch trunk some_branch
Branched 1 revision(s).
 $ bzr serve # note: no error
listening on port: 4155

Term 2:
 $ bzr info bzr://localhost
Shared repository with trees (format: unnamed)
Location:
  shared repository: bzr://localhost/
 $ bzr info bzr://localhost/some_branch
Repository branch (format: unnamed)
Location:
  shared repository: bzr://localhost/
  repository branch: bzr://localhost/some_branch/

Related branches:
  parent branch: bzr://localhost/trunk/

Term 1:
 $ cd trunk # now in repo/trunk
 $ bzr serve # note: no warning or error whatsoever
listening on port: 4155

Term 2: $ bzr info bzr://localhost
bzr: ERROR: Server sent an unexpected error: ('error', 'No repository present: "chroot-4321283472:///"')

Jelmer Vernooij (jelmer)
tags: added: chroot hpss serve
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
Changed in brz:
status: New → Triaged
importance: Undecided → Low
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.