~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/rules.py

  • Committer: Ian Clatworthy
  • Date: 2009-05-06 01:37:46 UTC
  • mfrom: (4324.4.1 bzr.rules)
  • mto: This revision was merged to the branch mainline in revision 4334.
  • Revision ID: ian.clatworthy@canonical.com-20090506013746-3d9zv74xyq6urodb
Make it easier to blackbox test rules (Marius Kruger)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
FILE_PREFS_PREFIX = 'name '
37
37
FILE_PREFS_PREFIX_LEN = len(FILE_PREFS_PREFIX)
38
38
 
 
39
# The object providing default rules
 
40
_per_user_searcher = None
 
41
 
39
42
 
40
43
class _RulesSearcher(object):
41
44
    """An object that provides rule-based preferences."""
146
149
    return osutils.pathjoin(config.config_dir(), 'rules')
147
150
 
148
151
 
149
 
# The object providing default rules
150
 
_per_user_searcher = _IniBasedRulesSearcher(rules_filename())
 
152
def reset_rules():
 
153
    global _per_user_searcher
 
154
    _per_user_searcher = _IniBasedRulesSearcher(rules_filename())
 
155
 
 
156
reset_rules()