[MERGE][#133782] Better error message when running ``bzr cat`` on a non-existant branch.

Martin Pool mbp at sourcefrog.net
Mon Sep 24 07:31:21 BST 2007

On 9/14/07, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> Aaron Bentley has voted comment.
> Status is now: Semi-approved
> Comment:
> I think it doesn't make sense to catch NotBranchError and pass-- if
> we're not referring to a file in a branch, then what are we referring
> to?

Currently it has this code:

2114         tree = None
2115         try:
2116             tree, b, relpath = \
2117                     bzrdir.BzrDir.open_containing_tree_or_branch(filename)
2118         except errors.NotBranchError:
2119             pass

I agree with Aaron: I don't understand why the except clause is there
on line 2118.  If we do catch the error and continue then relpath will
still be unbound and we will fail when we try to open it later.  If
you just remove that except clause, won't we get a reasonable message?

I think your test will still pass.

More information about the bazaar mailing list