/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-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

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
"""
24
24
import configobj
25
25
 
26
26
from . import (
27
 
    bedding,
 
27
    config,
28
28
    cmdline,
29
29
    errors,
30
30
    globbing,
106
106
                    self.pattern_to_section[fp] = s
107
107
        if len(patterns) < len(sections):
108
108
            unknowns = [s for s in sections
109
 
                        if not s.startswith(FILE_PREFS_PREFIX)]
 
109
                if not s.startswith(FILE_PREFS_PREFIX)]
110
110
            raise UnknownRules(unknowns)
111
111
        elif patterns:
112
112
            self._globster = globbing._OrderedGlobster(patterns)
162
162
        return ()
163
163
 
164
164
 
165
 
def rules_path():
166
 
    """Return the default rules file path."""
167
 
    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')
168
168
 
169
169
 
170
170
def reset_rules():
171
171
    global _per_user_searcher
172
 
    _per_user_searcher = _IniBasedRulesSearcher(rules_path())
173
 
 
 
172
    _per_user_searcher = _IniBasedRulesSearcher(rules_filename())
174
173
 
175
174
reset_rules()