/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/ignores.py

  • Committer: Martin
  • Date: 2019-06-16 01:03:51 UTC
  • mto: This revision was merged to the branch mainline in revision 7340.
  • Revision ID: gzlist@googlemail.com-20190616010351-uz89ydnwdoal4ve4
Split non-ini config methods to bedding

Functions that determine filesystem paths to use for config and default
username are now outside of the main (large) config module.

Also move cache_dir function from osutils and normalise logic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
lazy_import(globals(), """
28
28
from breezy import (
29
29
    atomicfile,
30
 
    config,
 
30
    bedding,
31
31
    globbing,
32
32
    trace,
33
33
    )
87
87
 
88
88
def get_user_ignores():
89
89
    """Get the list of user ignored files, possibly creating it."""
90
 
    path = config.user_ignore_config_filename()
 
90
    path = bedding.user_ignore_config_path()
91
91
    patterns = set(USER_DEFAULTS)
92
92
    try:
93
93
        f = open(path, 'rb')
121
121
    bad form to rewrite a user's ignore list.
122
122
    breezy only writes this file if it does not exist.
123
123
    """
124
 
    ignore_path = config.user_ignore_config_filename()
125
 
    config.ensure_config_dir_exists()
 
124
    ignore_path = bedding.user_ignore_config_path()
 
125
    bedding.ensure_config_dir_exists()
126
126
 
127
127
    # Create an empty file
128
128
    with open(ignore_path, 'wb') as f:
147
147
    if not to_add:
148
148
        return []
149
149
 
150
 
    with open(config.user_ignore_config_filename(), 'ab') as f:
 
150
    with open(bedding.user_ignore_config_path(), 'ab') as f:
151
151
        for pattern in to_add:
152
152
            f.write(pattern.encode('utf8') + b'\n')
153
153