[MERGE] Fix race condition with branch hooks during cloning when the new branch is stacked.

Robert Collins robertc at robertcollins.net
Wed Feb 25 22:41:58 GMT 2009


On Wed, 2009-02-25 at 17:33 -0500, Andrew Bennetts wrote:
> Andrew Bennetts has voted approve.
> Status is now: Approved
> Comment:
> Looks like a reasonable and simple fix.  It makes sense to me that 
> Branch.clone should be able to set the stacking details of the branch. 
> I'm not sure that passing a RepositoryPolicy is the best API, but I 
> think it's good enough.
> 
> One comment about the test; when writing tests that do assertions in 
> callbacks I tend to have the callback do "self.hook_was_called" so that 
> the test can do self.assertTrue(self.hook_was_called)" to guard against 
> an accidental gap in test coverage if for some reason the callback isn't 
> run.  I don't think it's serious risk in this case, but you're welcome 
> to share my habit ;)

I do - I assert that we have 1 or 2 calls made to the hook, as
appropriate :)

-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/20090226/d388211d/attachment-0001.pgp 


More information about the bazaar mailing list