~doxxx/bzr/bzrmeta-ignore

« back to all changes in this revision

Viewing changes to bzrlib/ignores.py

  • Committer: Gordon Tyler
  • Date: 2009-12-02 20:34:14 UTC
  • Revision ID: gordon@doxxx.net-20091202203414-uxq4no7pt7s9c0rt
Changed all instances of IGNORE_FILENAME and '.bzrignore' to '.bzrmeta/ignore'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Lists of ignore files, etc."""
18
18
 
19
19
import errno
 
20
import os
20
21
 
21
22
from bzrlib import (
22
23
    atomicfile,
24
25
    globbing,
25
26
    )
26
27
 
27
 
IGNORE_FILENAME = ".bzrignore"
28
 
 
29
28
# This was the full ignore list for bzr 0.8
30
29
# please keep these sorted (in C locale order) to aid merging
31
30
OLD_DEFAULTS = [
216
215
    :param tree: Tree to retrieve the ignore list from.
217
216
    :return:
218
217
    """
219
 
    ifn = tree.abspath(IGNORE_FILENAME)
 
218
    ifn = tree.abspath('.bzrmeta/ignore')
220
219
    if tree.has_filename(ifn):
221
220
        f = open(ifn, 'rt')
222
221
        try:
234
233
    for name_pattern in name_pattern_list:
235
234
        igns += name_pattern + '\n'
236
235
 
 
236
    # ensure .bzrmeta exists
 
237
    if not tree.has_filename('.bzrmeta'):
 
238
        tree.mkdir('.bzrmeta')
 
239
        
237
240
    f = atomicfile.AtomicFile(ifn, 'wb')
238
241
    try:
239
242
        f.write(igns.encode('utf-8'))
241
244
    finally:
242
245
        f.close()
243
246
 
244
 
    if not tree.path2id(IGNORE_FILENAME):
245
 
        tree.add([IGNORE_FILENAME])
 
247
    if not tree.path2id('.bzrmeta/ignore'):
 
248
        tree.add(['.bzrmeta/ignore'])