~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: John Arbash Meinel
  • Date: 2007-07-13 02:23:34 UTC
  • mfrom: (2592 +trunk) (2612 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2614.
  • Revision ID: john@arbash-meinel.com-20070713022334-qb6ewgo6v4251yd9
[merge] bzr.dev 2612

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
    errors,
78
78
    osutils,
79
79
    symbol_versioning,
 
80
    trace,
80
81
    urlutils,
81
82
    win32utils,
82
83
    )
639
640
                return value
640
641
        return None
641
642
 
642
 
    def set_user_option(self, name, value, store=STORE_BRANCH):
 
643
    def set_user_option(self, name, value, store=STORE_BRANCH,
 
644
        warn_masked=False):
643
645
        if store == STORE_BRANCH:
644
646
            self._get_branch_data_config().set_option(value, name)
645
647
        elif store == STORE_GLOBAL:
646
648
            self._get_global_config().set_user_option(name, value)
647
649
        else:
648
650
            self._get_location_config().set_user_option(name, value, store)
 
651
        if not warn_masked:
 
652
            return
 
653
        if store in (STORE_GLOBAL, STORE_BRANCH):
 
654
            mask_value = self._get_location_config().get_user_option(name)
 
655
            if mask_value is not None:
 
656
                trace.warning('Value "%s" is masked by "%s" from'
 
657
                              ' locations.conf', value, mask_value)
 
658
            else:
 
659
                if store == STORE_GLOBAL:
 
660
                    branch_config = self._get_branch_data_config()
 
661
                    mask_value = branch_config.get_user_option(name)
 
662
                    if mask_value is not None:
 
663
                        trace.warning('Value "%s" is masked by "%s" from'
 
664
                                      ' branch.conf', value, mask_value)
 
665
 
649
666
 
650
667
    def _gpg_signing_command(self):
651
668
        """See Config.gpg_signing_command."""