~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/debug.py

  • Committer: Martin Pool
  • Date: 2010-01-29 14:09:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4992.
  • Revision ID: mbp@sourcefrog.net-20100129140905-2uiarb6p8di1ywsr
Correction to url

from review: https://code.edge.launchpad.net/~mbp/bzr/doc/+merge/18250

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
def set_debug_flags_from_config():
32
32
    """Turn on debug flags based on the global configuration"""
33
33
 
34
 
    from bzrlib import config
 
34
    from bzrlib.config import GlobalConfig
35
35
 
36
 
    c = config.GlobalStack()
37
 
    for f in c.get('debug_flags'):
38
 
        debug_flags.add(f)
 
36
    c = GlobalConfig()
 
37
    value = c.get_user_option("debug_flags")
 
38
    if value is not None:
 
39
        # configobject gives us either a string if there's just one or a list
 
40
        # if there's multiple
 
41
        if isinstance(value, basestring):
 
42
            value = [value]
 
43
        for w in value:
 
44
            w = w.strip()
 
45
            debug_flags.add(w)