bzrlib.bzrdir.format_registry.set_default() cannot be called twice

Bug #113423 reported by John A Meinel
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We currently use format_registry.set_default(name) to define what branch
format should be the default.

Someone asked on IRC how to switch the default to dirstate-tags, so my
first thought was to do this in a plugin:

import bzrlib.bzrdir

bzrlib.bzrdir.format_registry.set_default('dirstate-tags')

That failed because it is actually registering the format "default", and
that format has already been registered.

The workaround is to add

bzrlib.bzrdir.format_registry.remove('default')

before the set_default() call.

To me, it seems more reasonable to either:

1) have 'set_default' check if default is already registered and remove it.
2) Have 'set_default' use the default logic that Registry already has.
(you can use registry.get(None) to get the default object, rather than
using a key like 'default').
This would mean you don't have 'default' registered

 affects /products/bzr
 importance low
 status confirmed
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQNWyJdeBCYSNAAMRAoLgAKCThr/UmmAuUWO+pztZUS+To7EtjQCfcECx
MTZOGHERySmK27bABkOVy3U=
=kD6H
-----END PGP SIGNATURE-----

Jelmer Vernooij (jelmer)
tags: added: api registry
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.