[MERGE] Enable setting and getting make_working_trees for all repositories
Robert Collins
robertc at robertcollins.net
Thu Apr 10 04:37:18 BST 2008
On Wed, 2008-04-09 at 23:02 -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert Collins wrote:
> > On Wed, 2008-04-09 at 22:41 -0400, Aaron Bentley wrote:
> >>> For that matter, I don't really
> >>> understand how this is a significant improvement over raising
> >>> NotImplementedError.
> >> NotImplementedError usually means someone forgot to implement
> >> something.
> >> I think that kind of error should trigger a test suite failure.
> >>
> >> ValueError means that the supplied value was unsuitable, and for
> >> AllInOne repositories, False is not a usable value. (True is, because
> >> that's the value they always use.)
> >
> > We use NotImplementedError pervasively in bzrlib for 'optional method
> > that this class does not implement'.
>
> Really?
>
> Because the use I'm familiar with is pseudo-pure-virtual-function, like
> Branch.pull and Tree.get_file. I have never had any reason to believe
> that those methods were optional. I strongly suspect that any
> implementation of Branch or Tree which lacked those functions would fail
> the test suite, and rightly so, in my opinion.
So perhaps we should update the optional methods with a new exception;
it could subclass NotImplementedError for compatibility if we want to.
A quick grep of the test suite for current uses of it in this manner:
bzrlib/tests/branch_implementations/test_branch.py: except NotImplementedError:
bzrlib/tests/branch_implementations/test_branch.py: except NotImplementedError:
bzrlib/tests/branch_implementations/test_break_lock.py: except NotImplementedError:
bzrlib/tests/branch_implementations/test_break_lock.py: except NotImplementedError:
bzrlib/tests/branch_implementations/test_break_lock.py: except NotImplementedError:
bzrlib/tests/branch_implementations/test_break_lock.py: except NotImplementedError:
bzrlib/tests/branch_implementations/test_locking.py: self.assertRaises(NotImplementedError,
bzrlib/tests/branch_implementations/test_locking.py: self.assertRaises(NotImplementedError,
bzrlib/tests/branch_implementations/test_locking.py: except NotImplementedError:
bzrlib/tests/branch_implementations/test_locking.py: except NotImplementedError:
bzrlib/tests/bzrdir_implementations/test_bzrdir.py: except NotImplementedError:
bzrlib/tests/bzrdir_implementations/test_bzrdir.py: except NotImplementedError:
bzrlib/tests/bzrdir_implementations/test_bzrdir.py: except (NotImplementedError, errors.LockActive):
bzrlib/tests/interversionedfile_implementations/test_join.py: # not support this need to raise NotImplementedError on the
bzrlib/tests/interversionedfile_implementations/test_join.py: except NotImplementedError:
bzrlib/tests/repository_implementations/test_break_lock.py: except NotImplementedError:
bzrlib/tests/repository_implementations/test_repository.py: except NotImplementedError:
bzrlib/tests/repository_implementations/test_repository.py: except NotImplementedError:
bzrlib/tests/repository_implementations/test_repository.py: except NotImplementedError:
bzrlib/tests/repository_implementations/test_repository.py: except NotImplementedError:
bzrlib/tests/repository_implementations/test_repository.py: except NotImplementedError, e:
bzrlib/tests/repository_implementations/test_repository.py: # This should work, not raise NotImplementedError:
bzrlib/tests/repository_implementations/test_repository.py: # should not raise NotImplementedError.
bzrlib/tests/repository_implementations/test_repository.py: self.assertRaises(NotImplementedError, repo.leave_lock_in_place)
bzrlib/tests/repository_implementations/test_repository.py: self.assertRaises(NotImplementedError,
bzrlib/tests/repository_implementations/test_repository.py: except NotImplementedError:
bzrlib/tests/workingtree_implementations/test_break_lock.py: except NotImplementedError:
bzrlib/tests/workingtree_implementations/test_break_lock.py: except NotImplementedError:
bzrlib/tests/workingtree_implementations/test_break_lock.py: except (NotImplementedError, errors.LockActive):
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080410/c2979439/attachment.pgp
More information about the bazaar
mailing list