/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/config.py

mergeĀ lp:~jelmer/bzr/commit-uses-config-stacks

Show diffs side-by-side

added added

removed removed

Lines of Context:
528
528
        """See acceptable_keys()."""
529
529
        return None
530
530
 
 
531
    @deprecated_method(deprecated_in((2, 5, 0)))
531
532
    def post_commit(self):
532
533
        """An ordered list of python functions to call.
533
534
 
559
560
        v = self._get_user_id()
560
561
        if v:
561
562
            return v
562
 
        v = os.environ.get('EMAIL')
563
 
        if v:
564
 
            return v.decode(osutils.get_user_encoding())
565
 
        name, email = _auto_user_id()
566
 
        if name and email:
567
 
            return '%s <%s>' % (name, email)
568
 
        elif email:
569
 
            return email
570
 
        raise errors.NoWhoami()
 
563
        return default_email()
571
564
 
572
565
    def ensure_username(self):
573
566
        """Raise errors.NoWhoami if username is not set.
2590
2583
 
2591
2584
 
2592
2585
def default_email():
 
2586
    v = os.environ.get('EMAIL')
 
2587
    if v:
 
2588
        return v.decode(osutils.get_user_encoding())
2593
2589
    name, email = _auto_user_id()
2594
2590
    if name and email:
2595
2591
        return u'%s <%s>' % (name, email)
2598
2594
    raise errors.NoWhoami()
2599
2595
 
2600
2596
 
 
2597
# FIXME: 'email' should also look at the BZR_EMAIL environment variable,
 
2598
# which takes precedence over the settings in the configuration file.
2601
2599
option_registry.register(
2602
2600
    Option('email', default=default_email,
2603
 
           default_from_env=['BZR_EMAIL', 'EMAIL'],
2604
2601
           help='The users identity'))
2605
2602
option_registry.register(
2606
2603
    Option('gpg_signing_command',
2658
2655
           help='''\
2659
2656
Post commit functions.
2660
2657
 
2661
 
An ordered list of python functions to call separated by spaces.
 
2658
An ordered list of python functions to call, separated by spaces.
2662
2659
 
2663
2660
Each function takes branch, rev_id as parameters.
2664
2661
'''))