[MERGE][1.7] Alert users when --stacked overrides format

John Arbash Meinel john at arbash-meinel.com
Tue Sep 2 21:27:50 BST 2008

Hash: SHA1

Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> David Ingamells wrote:
>>> With the --stacked option bzr branch produces the following message:
>>> using <bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5 object at
>>> 0x877a08c> for stacking
>>> I do not feel that such a cryptic message is appropriate: it looks like
>>> some kind of diagnostic that was not removed before release.
>>> BTW. Performance is great with this version :^)
>>> David.
>> It is alerting you that it is changing the format of your branch.
> No, he requested stacking, but didn't say where to stack on, so it tried
> to tell him where it would stack on.
> Aaron

He was hitting this logic:
            if not repository_format.supports_external_lookups:
                # should possibly be controlled by the registry rather than
                # hardcoded here.
                from bzrlib.repofmt import pack_repo
                if repository_format.rich_root_data:
                    repository_format = \
                    repository_format = pack_repo.RepositoryFormatKnitPack5()
                note("using %r for stacking" % (repository_format,))

Which is "You asked for stacking, but the repository doesn't support it, so
I'm going to use a different format and tell you about it".

It didn't have anything to do with "where to stack on".

Your new code has a different path, which doesn't trigger this. Which is a bit
sad, because I *do* think we should tell people when we use a branch format
that isn't backwards compatible.


$ bzr1.6 branch --stacked ~/dev/bzr/bzr.dev
using <bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5 object at 0x8a0930c>
for stacking
Created new stacked branch referring to file:///home/jameinel/dev/bzr/bzr.dev/.

$ bzr.dev branch --stacked ~/dev/bzr/bzr.dev
                                           Created new stacked branch
referring to file:///home/jameinel/dev/bzr/bzr.dev/.

bzr info

reports that the new branch is in format 1.6 in both cases.

So I'm proposing the attached patch for bzr-1.7 which gives:
$ bzr branch --stacked ~/dev/bzr/bzr.dev
Stacking requires repository format:
  Packs 5 (adds stacking support, requires bzr 1.6)
Not preserving source format.
Created new stacked branch referring to file:///home/jameinel/dev/bzr/bzr.dev/.

Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: note_upgrades.patch
Type: text/x-diff
Size: 2772 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080902/8f73a866/attachment.bin 

More information about the bazaar mailing list