[patch] bzrtools should not append to DEFAULT_IGNORE

Adeodato Simó dato at net.com.org.es
Fri Jul 21 14:51:58 BST 2006


* John Arbash Meinel [Fri, 21 Jul 2006 08:12:11 -0500]:

> The attached patch is a fix for bzrtools to avoid the current
> DEPRECATION warnings that we get since my ignore changes landed.

In 20060718061531.GA6726 at gifted Martin recommended to use version_info
instead, so in case somebody likes it better, attached is the patch that
I applied to my bzrtools copy when the ignore changes landed.

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
I don't want to achieve immortality through my work. I want to achieve
immortality through not dying.
                -- Woody Allen
-------------- next part --------------
=== modified file '__init__.py'
--- __init__.py	2006-07-17 13:28:17 +0000
+++ __init__.py	2006-07-21 13:46:54 +0000
@@ -10,7 +10,7 @@
 import sys
 import os.path
 
-from bzrlib import DEFAULT_IGNORE
+from bzrlib import version_info
 import bzrlib.builtins
 import bzrlib.branch
 import bzrlib.commands
@@ -21,10 +21,14 @@
 sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), 
                                                  "external")))
 
-
-DEFAULT_IGNORE.append('./.shelf')
-DEFAULT_IGNORE.append('./.bzr-shelf*')
-
+if version_info[0] * 10 + version_info[1] >= 9:
+    from bzrlib import ignores
+    ignore_function = ignores.add_runtime_ignores
+else:
+    from bzrlib import DEFAULT_IGNORE
+    ignore_function = DEFAULT_IGNORE.extend
+
+ignore_function(['./.shelf', './.bzr-shelf*'])
 
 class cmd_clean_tree(bzrlib.commands.Command):
     """Remove unwanted files from working tree.



More information about the bazaar mailing list