Merge lp:~bialix/bzr/ignores-docstring into lp:bzr

Proposed by Alexander Belchenko
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~bialix/bzr/ignores-docstring
Merge into: lp:bzr
Diff against target: 26 lines (+6/-5)
1 file modified
bzrlib/ignores.py (+6/-5)
To merge this branch: bzr merge lp:~bialix/bzr/ignores-docstring
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+24471@code.launchpad.net

Commit message

Improve the docstring for tree_ignores_add_patterns and remove a magic constant.

Description of the change

This branch put the docstring of tree_ignores_add_patterns to reflect the real code. Currently it does not. At all.

Also I've changed the '.bzrignore' literal to named constant from bzrlib/__init__.py to keep consistency.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/ignores.py'
--- bzrlib/ignores.py 2010-04-26 13:51:08 +0000
+++ bzrlib/ignores.py 2010-04-30 07:59:16 +0000
@@ -176,10 +176,11 @@
176176
177177
178def tree_ignores_add_patterns(tree, name_pattern_list):178def 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.
180182
181 :param tree: Tree to retrieve the ignore list from.183 :param tree: Working tree to update the ignore list.
182 :return:
183 """184 """
184 ifn = tree.abspath(bzrlib.IGNORE_FILENAME)185 ifn = tree.abspath(bzrlib.IGNORE_FILENAME)
185 if tree.has_filename(ifn):186 if tree.has_filename(ifn):
@@ -206,5 +207,5 @@
206 finally:207 finally:
207 f.close()208 f.close()
208209
209 if not tree.path2id('.bzrignore'):210 if not tree.path2id(bzrlib.IGNORE_FILENAME):
210 tree.add(['.bzrignore'])211 tree.add([bzrlib.IGNORE_FILENAME])