[MERGE] RepositoryFormat.network_name.

Andrew Bennetts andrew.bennetts at canonical.com
Fri Feb 20 01:40:02 GMT 2009


Robert Collins wrote:
> This branch adds a RepositoryFormat.network_name method. We'll need a
> similar thing for BranchFormat and BzrDirFormat eventually, but this
> seems robust and complete for now. We use this in network streaming
> (coming in a later patch) so that the server can determine the encoding
> of the stream. [Note that issues relating to formats the server and
> client don't have in common are orthogonal to this patch - a client
> could send a format that is wire compatible with its stream but older
> [or newer] than the actual disk format, if desired].
> 
> Separately to the streaming case, this patch is a prerequisite for
> having the server create repositories directly rather than doing it via
> VFS methods.
> 
> -Rob

bb:tweak

> === modified file 'bzrlib/remote.py'
[...]
> +    :ivar _creating_repo: If set, the repository object that this
> +        RemoteRepositoryFormat was created for: it can be called into
> +        to obtain data like te network name.

s/te/the

> === modified file 'bzrlib/repofmt/weaverepo.py'
> --- bzrlib/repofmt/weaverepo.py	2008-11-21 02:52:32 +0000
> +++ bzrlib/repofmt/weaverepo.py	2009-02-19 03:09:55 +0000
> @@ -399,6 +399,10 @@
>      def get_format_description(self):
>          """See RepositoryFormat.get_format_description()."""
>          return "Weave repository format 5"
> +    
> +    def network_name(self):
> +        """The network name for this format is the control dirs disk label."""
> +        return self._matchingbzrdir.get_format_string()

Maybe add a comment here to emphasise that that's because this is an all-in-one
format?  That may help John's confusion.

> +    def network_name(self):
> +        """The network name for this format is the control dirs disk label."""
> +        return self._matchingbzrdir.get_format_string()

Ditto...

> === modified file 'bzrlib/repository.py'
[...]
> +# Pre-0.8 formats that don't have a disk format string (because they are
> +# versioned by the matching control directory). We use the control directories
> +# disk format string as a key for the network_name because they meet the
> +# constraints (simple string, unique, immmutable).

Or maybe you just need to convince 'bzr send' to produce a diff with this
comment at the top ;)

-Andrew.




More information about the bazaar mailing list