[MERGE][Bug #64783] Fixing check to understand the split-up .bzr format
Daniel Mark Watkins
D.M.Watkins at warwick.ac.uk
Wed Apr 23 10:46:23 BST 2008
One month later...
On Mon, 24 Mar 2008 21:41:58 -0400
Aaron Bentley <aaron at aaronbentley.com> wrote:
> > + @classmethod
> > + def open_containing_tree_branch_or_repository(klass, location):
> > + """Return the branch, working tree and repo contained by a
> > location. +
> > + Returns (tree, branch, repository).
> > + If there is no tree containing the location, tree will be
> > None.
> > + If there is no branch containing the location, branch will
> > be None.
> > + If there is no repository containing the location,
> > repository will be
> > + None.
> > +
> > + If no branch, tree or repository is found, a
> > NotVersionedError is
> > + raised.
> > + """
> > + try:
> > + tree, branch, relpath = \
> > + klass.open_containing_tree_or_branch(location)
> > + except errors.NotBranchError:
> > + try:
> > + repo =
> > klass.open_containing(location)[0].find_repository()
> > + return None, None, repo
> > + except (errors.NoRepositoryPresent,
> > errors.NotBranchError):
> > + raise errors.NotVersionedError(location)
>
> ^^^ It would be a bit more efficient to call klass.open_containing,
> and then call BzrDir._get_tree_branch
Done in attached.
> > + def
> > test_open_containing_tree_branch_or_repository_branch_subdir(self):
> > + self.make_branch_and_tree('foo')
> > + os.mkdir('foo/bar') #XXX
Fixed.
> > + def
> > test_open_containing_tree_branch_or_repository_repo_subdir(self):
> > + self.make_repository('bar')
> > + os.mkdir('bar/baz') #XXX
And fixed.
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check.5.patch
Type: text/x-patch
Size: 43264 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080423/b29a6678/attachment-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080423/b29a6678/attachment-0002.pgp
More information about the bazaar
mailing list