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
1=== modified file 'bzrlib/ignores.py'
2--- bzrlib/ignores.py 2010-04-26 13:51:08 +0000
3+++ bzrlib/ignores.py 2010-04-30 07:59:16 +0000
4@@ -176,10 +176,11 @@
5
6
7 def tree_ignores_add_patterns(tree, name_pattern_list):
8- """Retrieve a list of ignores from the ignore file in a tree.
9+ """Add more ignore patterns to the ignore file in a tree.
10+ If ignore file does not exist then it will be created.
11+ The ignore file will be automatically added under version control.
12
13- :param tree: Tree to retrieve the ignore list from.
14- :return:
15+ :param tree: Working tree to update the ignore list.
16 """
17 ifn = tree.abspath(bzrlib.IGNORE_FILENAME)
18 if tree.has_filename(ifn):
19@@ -206,5 +207,5 @@
20 finally:
21 f.close()
22
23- if not tree.path2id('.bzrignore'):
24- tree.add(['.bzrignore'])
25+ if not tree.path2id(bzrlib.IGNORE_FILENAME):
26+ tree.add([bzrlib.IGNORE_FILENAME])