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

Only chown() the .bzr.log when creating it, fixing NEWS entry to put it under 2.2b3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
59
59
        # Otherwise go though line by line and pick out the 'good'
60
60
        # decodable lines
61
61
        lines = ignore_file.split('\n')
62
 
        unicode_lines = []
 
62
        unicode_lines = []    
63
63
        for line_number, line in enumerate(lines):
64
64
            try:
65
65
                unicode_lines.append(line.decode('utf-8'))
67
67
                # report error about line (idx+1)
68
68
                warning('.bzrignore: On Line #%d, malformed utf8 character. '
69
69
                        'Ignoring line.' % (line_number+1))
70
 
 
 
70
    
71
71
    # Append each line to ignore list if it's not a comment line
72
72
    for line in unicode_lines:
73
73
        line = line.rstrip('\r\n')
176
176
 
177
177
 
178
178
def tree_ignores_add_patterns(tree, name_pattern_list):
179
 
    """Add more ignore patterns to the ignore file in a tree.
180
 
    If ignore file does not exist then it will be created.
181
 
    The ignore file will be automatically added under version control.
 
179
    """Retrieve a list of ignores from the ignore file in a tree.
182
180
 
183
 
    :param tree: Working tree to update the ignore list.
 
181
    :param tree: Tree to retrieve the ignore list from.
 
182
    :return:
184
183
    """
185
184
    ifn = tree.abspath(bzrlib.IGNORE_FILENAME)
186
185
    if tree.has_filename(ifn):
207
206
    finally:
208
207
        f.close()
209
208
 
210
 
    if not tree.path2id(bzrlib.IGNORE_FILENAME):
211
 
        tree.add([bzrlib.IGNORE_FILENAME])
 
209
    if not tree.path2id('.bzrignore'):
 
210
        tree.add(['.bzrignore'])