[RFC] Conditionalize format warnings

Aaron Bentley aaron.bentley at utoronto.ca
Tue Apr 17 03:59:11 BST 2007


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

Matthew D. Fuller wrote:
> This seems to cover it.  It still kinda bugs me that we're checking a
> Branch config to determine whether to warn about a WorkingTree format,
> but I guess the world is an imperfect place ("screws fall out all the
> time").

Well, you can still use locations.conf to configure it.  That's where we
tend to stuff config information for repositories.

> +            # Warnings may be disabled by config
> +            if basedir is not None:
> +                branch = Branch.open(basedir)
> +                fwarn = config.BranchConfig(branch).get_format_warning()

It is typical to invoke branch.get_config(), which allows the branch to
further customize the class if desired.

> +            else:
> +                fwarn = config.GlobalConfig().get_format_warning()

I don't think it's worth considering the case where there's a working
tree but no branch.  Such a construct is useless to Bazaar, and is
exceedingly rare.

Also, we'll need some test cases before this request can be accepted.
If you do wish to fall back to GlobalConfig, you'll need to test that as
well.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJDf/0F+nu1YWqI0RApQiAJ9z/klrWVKMVCR55JiIw6cFgaMLrgCgiRbh
/yOaaaaqKQQc8VkZL2f/lVM=
=sqLY
-----END PGP SIGNATURE-----



More information about the bazaar mailing list