/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 breezy/rules.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Rule-based definition of preferences for selected files in selected branches
 
17
"""Rule-based definition of preferences for selected files in selected branches.
18
18
 
19
19
See ``bzr help rules`` for details.
20
20
"""
21
21
 
 
22
from __future__ import absolute_import
 
23
 
22
24
import configobj
23
25
 
24
26
from . import (
25
 
    bedding,
 
27
    config,
26
28
    cmdline,
27
29
    errors,
28
30
    globbing,
104
106
                    self.pattern_to_section[fp] = s
105
107
        if len(patterns) < len(sections):
106
108
            unknowns = [s for s in sections
107
 
                        if not s.startswith(FILE_PREFS_PREFIX)]
 
109
                if not s.startswith(FILE_PREFS_PREFIX)]
108
110
            raise UnknownRules(unknowns)
109
111
        elif patterns:
110
112
            self._globster = globbing._OrderedGlobster(patterns)
160
162
        return ()
161
163
 
162
164
 
163
 
def rules_path():
164
 
    """Return the default rules file path."""
165
 
    return osutils.pathjoin(bedding.config_dir(), 'rules')
 
165
def rules_filename():
 
166
    """Return the default rules filename."""
 
167
    return osutils.pathjoin(config.config_dir(), 'rules')
166
168
 
167
169
 
168
170
def reset_rules():
169
171
    global _per_user_searcher
170
 
    _per_user_searcher = _IniBasedRulesSearcher(rules_path())
171
 
 
 
172
    _per_user_searcher = _IniBasedRulesSearcher(rules_filename())
172
173
 
173
174
reset_rules()