[MERGE] test_sprout_uses_bzrdir_branch_format
Robert Collins
robertc at robertcollins.net
Thu Feb 12 20:43:47 GMT 2009
On Thu, 2009-02-12 at 10:26 -0600, John Arbash Meinel wrote:
>
>
> > I am staring at this test now, to make it work with RemoteBranch
> with
> > some other changes going on; what I propose to do in the short term
> is
> > punt on testing with Remote; its no worse that what is in bzr.dev at
> the
> > moment.
>
> It works with RemoteBranch at the moment. I'm not sure what you are
> looking at "fixing". RemoteBranchFormat knows about using
> "self._ensure_real" to get the actual remote format, and pass that
> along.
Currently the test ends up asserting:
self.assertIs(self.branch_format.__class__,target._format.__class__)
Which is another way of saying "we end up with a RemoteBranchFormat. So
its not asserting anything useful about the actual real format chosen.
target could end up a git branch, and this test would still pass for
RemoteBranchFormat.
We have to unwrap the left hand side to get a real format to make a
useful assertion; but the left hand side here has no real format because
its not backed by an actual branch.
> The point I have above is that I'm setting an attribute of
> "RemoteBranchFormat._matchingbzrdir" so that
> "_matchingbzrdir.get_branch_format()" returns RemoteBranchFormat,
> rather
> than just hard-coding RemoteBzrDirFormat.get_branch_format() to always
> return RemoteBranchFormat.
>
> The end result would be the same either way.
Well, sure, I don't know that I want to change the end result. I do want
to make the test useful, and that needs a clear end user description of
what should happen. I'm still not clear: is it
"formats are preserved except when a user request [like stacking]
requires a change to satisfy the request?"
> > However, in terms of correct behaviour, I'd like to see branching
> across
> > preserve the format - this helps people moving ahead of stable as
> much
> > as it does laggards that want to read their contributors branches.
> We
> > have tests for stacking working, so I can make sure that stacking
> isn't
> > harmed at all doing this.
> >
> > -Rob
>
> My direct concern is that you are misunderstanding the test, and will
> punt for RemoteBranch objects when we shouldn't need to.
Thank you :) But I don't think I am!
-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090213/7f734791/attachment.pgp
More information about the bazaar
mailing list