~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-05-15 17:40:32 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070515174032-qzdkangpv29l9e7g
Add a test that check that init connect only once. It fails.

* __init__.py:
(test_suite): Register the new test class.

* test_init.py: 
(InstrumentedTransport): A transport that can track connections.
(TransportHooks): Transport specific hooks.
(TestInit): Iniit command behavior tests.

* ftp.py:
(FtpTransport.__init__): Mark place that need fixing regarding
transport connection sharing

* builtins.py:
(cmd_init.run): Mark places that need fixing regarding transport
connection sharing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
    errors,
78
78
    osutils,
79
79
    symbol_versioning,
80
 
    trace,
81
80
    urlutils,
82
81
    win32utils,
83
82
    )
640
639
                return value
641
640
        return None
642
641
 
643
 
    def set_user_option(self, name, value, store=STORE_BRANCH,
644
 
        warn_masked=False):
 
642
    def set_user_option(self, name, value, store=STORE_BRANCH):
645
643
        if store == STORE_BRANCH:
646
644
            self._get_branch_data_config().set_option(value, name)
647
645
        elif store == STORE_GLOBAL:
648
646
            self._get_global_config().set_user_option(name, value)
649
647
        else:
650
648
            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
 
 
666
649
 
667
650
    def _gpg_signing_command(self):
668
651
        """See Config.gpg_signing_command."""
869
852
            obj = self._get_config()
870
853
            try:
871
854
                if section is not None:
872
 
                    obj = obj[section]
 
855
                    obj[section]
873
856
                result = obj[name]
874
857
            except KeyError:
875
858
                result = default