/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: Jelmer Vernooij
  • Date: 2018-03-24 17:48:04 UTC
  • mfrom: (6921 work)
  • mto: This revision was merged to the branch mainline in revision 6923.
  • Revision ID: jelmer@jelmer.uk-20180324174804-xf22o05byoj12x1q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
    :return: None
191
191
    """
192
192
    # read in the existing ignores set
193
 
    ifn = tree.abspath(breezy.IGNORE_FILENAME)
 
193
    ifn = tree.abspath(tree._format.ignore_filename)
194
194
    if tree.has_filename(ifn):
195
195
        with open(ifn, 'rbU') as f:
196
196
            file_contents = f.read()
203
203
    else:
204
204
        file_contents = b""
205
205
        newline = os.linesep.encode()
206
 
    
 
206
 
207
207
    sio = BytesIO(file_contents)
208
208
    try:
209
209
        ignores = parse_ignore_file(sio)
210
210
    finally:
211
211
        sio.close()
212
 
    
 
212
 
213
213
    # write out the updated ignores set
214
214
    f = atomicfile.AtomicFile(ifn, 'wb')
215
215
    try:
225
225
    finally:
226
226
        f.close()
227
227
 
228
 
    if not tree.path2id(breezy.IGNORE_FILENAME):
229
 
        tree.add([breezy.IGNORE_FILENAME])
 
228
    if not tree.is_versioned(tree._format.ignore_filename):
 
229
        tree.add([tree._format.ignore_filename])