[rfc] Readonly/mirror branches

John A Meinel john at arbash-meinel.com
Mon May 8 17:27:45 BST 2006


Martin Pool wrote:

...

> 
> There's a bug open about (presumably) the same thing in the context of
> checkout.  Robert says it is indeed due to trying to take a lock on the
> remote branch.  There's no conceptual reason why you shouldn't be able
> to get a checkout or bound copy of a remote branch.

If you look at the bind() code, there is even a comment left there for:
        # TODO: capture an exception which indicates the remote branch
        #       is not writeable.
        #       If it is up-to-date, this probably should not be a failure


> 
> Is there anything needed for really good mirroring beyond just making it
> readonly?
> 
> (One thing would be remembering all of the branches that potentially
> need to be pushed & pulled before going offline.)
> 
>> Anyway, I just wanted to hear comments from people to see if a mirror
>> flag might be worthwhile. Readonly is probably too strong, since I do
>> want to be able to update it.
> 
> I would also want to prevent myself accidentally pushing into that
> branch.  Having a readonly binding would probably do it.
> 
> The 'readonly+' url decorator seems like a fairly reasonable UI for it
> -- you can see how to turn it on and off by rebinding.
> 
> --Martin


It is one that should be able to work for now. The bind() workaround
could be handled by just checking what other.last_revision() is, and if
it is == self.last_revision() you don't need to lock_write() and do the
reverse pull.

It is probably easier than handling the exception.

The attached patch should handle the readonly but up-to-date issue,
though we really need test cases, and probably better error handling.

John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bind-readonly.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060508/9d5768bf/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060508/9d5768bf/attachment.pgp 


More information about the bazaar mailing list