~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ignores.py

  • Committer: Alexander Belchenko
  • Date: 2010-04-30 07:54:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5196.
  • Revision ID: bialix@ukr.net-20100430075433-w19uwxoo2vds3mdt
rewrited docstring for tree_ignores_add_patterns function to reflect the reality. also changed literal .bzrignore to bzrlib.IGNORE_FILENAME to keep consistency within that function.

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
 
    """Retrieve a list of ignores from the ignore file in a tree.
 
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.
180
182
 
181
 
    :param tree: Tree to retrieve the ignore list from.
182
 
    :return:
 
183
    :param tree: Working tree to update the ignore list.
183
184
    """
184
185
    ifn = tree.abspath(bzrlib.IGNORE_FILENAME)
185
186
    if tree.has_filename(ifn):
206
207
    finally:
207
208
        f.close()
208
209
 
209
 
    if not tree.path2id('.bzrignore'):
210
 
        tree.add(['.bzrignore'])
 
210
    if not tree.path2id(bzrlib.IGNORE_FILENAME):
 
211
        tree.add([bzrlib.IGNORE_FILENAME])