Rev 5196: (lifeless) Improve the docstring for tree_ignores_add_patterns and remove a magic constant. (Alexander Belchenko) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat May 1 04:18:58 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5196 [merge]
revision-id: pqm at pqm.ubuntu.com-20100501031857-vbb4gqeyoi1wgdfn
parent: pqm at pqm.ubuntu.com-20100430070901-8y3zhvv3o9cqcmlv
parent: bialix at ukr.net-20100430075433-w19uwxoo2vds3mdt
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2010-05-01 04:18:57 +0100
message:
  (lifeless) Improve the docstring for tree_ignores_add_patterns and remove a magic constant. (Alexander Belchenko)
modified:
  bzrlib/ignores.py              ignores.py-20060712153832-2von9l0t7p43ixsv-1
=== modified file 'bzrlib/ignores.py'
--- a/bzrlib/ignores.py	2010-04-26 13:51:08 +0000
+++ b/bzrlib/ignores.py	2010-04-30 07:54:33 +0000
@@ -176,10 +176,11 @@
 
 
 def tree_ignores_add_patterns(tree, name_pattern_list):
-    """Retrieve a list of ignores from the ignore file in a tree.
+    """Add more ignore patterns to the ignore file in a tree.
+    If ignore file does not exist then it will be created.
+    The ignore file will be automatically added under version control.
 
-    :param tree: Tree to retrieve the ignore list from.
-    :return:
+    :param tree: Working tree to update the ignore list.
     """
     ifn = tree.abspath(bzrlib.IGNORE_FILENAME)
     if tree.has_filename(ifn):
@@ -206,5 +207,5 @@
     finally:
         f.close()
 
-    if not tree.path2id('.bzrignore'):
-        tree.add(['.bzrignore'])
+    if not tree.path2id(bzrlib.IGNORE_FILENAME):
+        tree.add([bzrlib.IGNORE_FILENAME])




More information about the bazaar-commits mailing list