55
55
turns on create_signatures.
56
56
create_signatures - this option controls whether bzr will always create
57
57
gpg signatures or not on commits. There is an unused
58
option which in future is expected to work if
58
option which in future is expected to work if
59
59
branch settings require signatures.
60
60
log_format - this option sets the default log format. Possible values are
61
61
long, short, line, or a plugin can register new formats.
240
239
return diff.DiffFromTool.from_string(cmd, old_tree, new_tree,
243
def get_mail_client(self):
244
"""Get a mail client to use"""
245
selected_client = self.get_user_option('mail_client')
246
_registry = mail_client.mail_client_registry
248
mail_client_class = _registry.get(selected_client)
250
raise errors.UnknownMailClient(selected_client)
251
return mail_client_class(self)
253
242
def _get_signature_checking(self):
254
243
"""Template method to override signature checking policy."""
1526
1515
def config_dir():
1527
"""Return per-user configuration directory.
1516
"""Return per-user configuration directory as unicode string
1529
1518
By default this is %APPDATA%/bazaar/2.0 on Windows, ~/.bazaar on Mac OS X
1530
1519
and Linux. On Linux, if there is a $XDG_CONFIG_HOME/bazaar directory,
1533
1522
TODO: Global option --config-dir to override this.
1535
base = os.environ.get('BZR_HOME', None)
1524
base = osutils.path_from_environ('BZR_HOME')
1536
1525
if sys.platform == 'win32':
1537
# environ variables on Windows are in user encoding/mbcs. So decode
1539
if base is not None:
1540
base = base.decode('mbcs')
1542
base = win32utils.get_appdata_location_unicode()
1544
base = os.environ.get('HOME', None)
1545
if base is not None:
1546
base = base.decode('mbcs')
1548
raise errors.BzrError('You must have one of BZR_HOME, APPDATA,'
1527
base = win32utils.get_appdata_location()
1529
base = win32utils.get_home_location()
1530
# GZ 2012-02-01: Really the two level subdirs only make sense inside
1531
# APPDATA, but hard to move. See bug 348640 for more.
1550
1532
return osutils.pathjoin(base, 'bazaar', '2.0')
1552
if base is not None:
1553
base = base.decode(osutils._fs_enc)
1554
if sys.platform == 'darwin':
1556
# this takes into account $HOME
1557
base = os.path.expanduser("~")
1558
return osutils.pathjoin(base, '.bazaar')
1561
xdg_dir = os.environ.get('XDG_CONFIG_HOME', None)
1534
# GZ 2012-02-01: What should OSX use instead of XDG if anything?
1535
if sys.platform != 'darwin':
1536
xdg_dir = osutils.path_from_environ('XDG_CONFIG_HOME')
1562
1537
if xdg_dir is None:
1563
xdg_dir = osutils.pathjoin(os.path.expanduser("~"), ".config")
1538
xdg_dir = osutils.pathjoin(osutils._get_home_dir(), ".config")
1564
1539
xdg_dir = osutils.pathjoin(xdg_dir, 'bazaar')
1565
1540
if osutils.isdir(xdg_dir):
1567
1542
"Using configuration in XDG directory %s." % xdg_dir)
1569
base = os.path.expanduser("~")
1570
return osutils.pathjoin(base, ".bazaar")
1544
base = osutils._get_home_dir()
1545
return osutils.pathjoin(base, ".bazaar")
1573
1548
def config_filename():
2684
2659
Whether revisions associated with tags should be fetched.
2661
option_registry.register_lazy(
2662
'bzr.transform.orphan_policy', 'bzrlib.transform', 'opt_transform_orphan')
2686
2663
option_registry.register(
2687
2664
Option('bzr.workingtree.worth_saving_limit', default=10,
2688
2665
from_unicode=int_from_store, invalid='warning',
2803
2780
Standard log formats are ``long``, ``short`` and ``line``. Additional formats
2804
2781
may be provided by plugins.
2783
option_registry.register_lazy('mail_client', 'bzrlib.mail_client',
2806
2785
option_registry.register(
2807
2786
Option('output_encoding',
2808
2787
help= 'Unicode encoding for output'