merging in versioned-file

Robert Collins robertc at robertcollins.net
Fri Feb 17 08:20:43 GMT 2006


So I've started on the merge conflict resolution for this, and Martin
and I [hes camping at my place for 'net until his new adsl is installed]
looked at some of the structural changes involved.

A couple of obvious things:

The transport changes are not backwards compatible, so we're going to
deprecate the existing names and provide new names like 'open_append'
rather than replacing the meaning of 'append'. 

Secondly, the fetcher logic is depending on the type code of the branch,
and Martin and I have hammered out what seems to be a good solution to
this recurring pattern - we have fast code paths between two
implementations of an interface and a slower generic code path.

I.e. 'copy_multi_to' and 'fetch'.

So we are proposing that we introduce a 'InterTYPE' concept in these
cases (specifically for the fetcher at this point). The InterTYPE
interface will provide the methods that operate between two objects of
TYPE, and will be subclassed or overridden as appropriate. We may
provide a facade to make this look seamless (in fact, will have to for
backwards compatability).

So sample code without the facade will look something like:

fetcher = InterRepository.get(from_repo, to_repo)
fetcher.fetch(revision_id=XXX, basis=YYY)


fetcher here is the variable name, but the object returned will have
methods on it for all of the inter-repository operations -
copy_content_into, fetch (at this point). For transports for instance it
would have the *into methods on it.


Whether those methods have local variables or instance variables, or
whether they use MethodObjects or not is up to the individual concrete
classes. 

The goal is to allow plugins that add transports or repositories or ...
to add fast code paths as appropriate rather than having the slow code
path kick in as soon as someone extends the system. (I.e. if you add a
weave based format that is compatible for 'fetch' you should be able to
have fast weave fetches occur.)


Rob


-- 
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/20060217/cebeddc7/attachment.pgp 


More information about the bazaar mailing list