/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

  • Committer: John Arbash Meinel
  • Date: 2007-07-11 23:45:20 UTC
  • mfrom: (2601 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2643.
  • Revision ID: john@arbash-meinel.com-20070711234520-do3h7zw8skbathpz
[merge] bzr.dev 2601

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."""
852
869
            obj = self._get_config()
853
870
            try:
854
871
                if section is not None:
855
 
                    obj[section]
 
872
                    obj = obj[section]
856
873
                result = obj[name]
857
874
            except KeyError:
858
875
                result = default