~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ignores.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-28 09:40:23 UTC
  • mfrom: (5155.1.5 320119-exclude-ancestry)
  • Revision ID: pqm@pqm.ubuntu.com-20100428094023-7504mlou1qk28r9n
(vila) Add --exclude-common-ancestry log option (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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'])