~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Vincent Ladeuil
  • Date: 2011-09-29 13:54:10 UTC
  • mto: This revision was merged to the branch mainline in revision 6178.
  • Revision ID: v.ladeuil+lp@free.fr-20110929135410-gv714ay1lg6ttehv
Get rid of the --override-config long name, ensures the overrides are resest when the command has run.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2646
2646
 
2647
2647
 
2648
2648
class CommandLineSection(MutableSection):
2649
 
    """A section used to carry command line option overrides."""
 
2649
    """A section used to carry command line overrides for the config options."""
2650
2650
 
2651
2651
    def __init__(self, opts=None):
2652
2652
        if opts is None:
2653
2653
            opts = {}
2654
2654
        super(CommandLineSection, self).__init__('cmdline-overrides', opts)
2655
2655
 
 
2656
    def _reset(self):
 
2657
        # The dict should be cleared but not replaced so it can be shared.
 
2658
        self.options.clear()
 
2659
 
2656
2660
    def _from_cmdline(self, overrides):
2657
2661
        # Reset before accepting new definitions
2658
 
        self.options.clear()
 
2662
        self._reset()
2659
2663
        for over in overrides:
2660
2664
            try:
2661
2665
                name, value = over.split('=', 1)