Rev 5178: (vila) Implement 'ignore --default-rules', remove 'ignore --old-default-rules' (Parth Malwankar) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Apr 23 10:52:59 BST 2010


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

------------------------------------------------------------
revno: 5178 [merge]
revision-id: pqm at pqm.ubuntu.com-20100423095255-jnjgd9kw6ga5h604
parent: pqm at pqm.ubuntu.com-20100423083538-2fokv22a7e596kmb
parent: parth.malwankar at gmail.com-20100422140757-agf525dm3dxf3jec
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-04-23 10:52:55 +0100
message:
  (vila) Implement 'ignore --default-rules', remove 'ignore --old-default-rules' (Parth Malwankar)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/ignores.py              ignores.py-20060712153832-2von9l0t7p43ixsv-1
  bzrlib/tests/blackbox/test_ignore.py test_ignore.py-20060703063225-4tm8dc2pa7wwg2t3-1
=== modified file 'NEWS'
--- a/NEWS	2010-04-23 07:15:23 +0000
+++ b/NEWS	2010-04-23 09:52:55 +0000
@@ -58,6 +58,11 @@
 * ``bzr diff`` now supports a --format option, which can be used to 
   select alternative diff formats. (Jelmer Vernooij, #555994)
 
+* ``bzr ignore`` now supports a ``--default-rules`` option that displays
+  the default ignore rules used by bzr. The flag ``--old-default-rules``
+  is no longer supported by ``ignore``.
+  (Parth Malwankar, #538703)
+
 * ``bzr pack`` now supports a ``--clean-obsolete-packs`` option that
   can save disk space by deleting obsolete pack files created during the
   pack operation.

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2010-04-22 15:44:21 +0000
+++ b/bzrlib/builtins.py	2010-04-23 09:52:55 +0000
@@ -2649,6 +2649,12 @@
     using this command or directly by using an editor, be sure to commit
     it.
     
+    Bazaar also supports a global ignore file ~/.bazaar/ignore. On Windows
+    the global ignore file can be found in the application data directory as
+    C:\\Documents and Settings\\<user>\\Application Data\\Bazaar\\2.0\\ignore.
+    Global ignores are not touched by this command. The global ignore file
+    can be edited directly using an editor.
+
     Patterns prefixed with '!' are exceptions to ignore patterns and take
     precedence over regular ignores.  Such exceptions are used to specify
     files that should be versioned which would otherwise be ignored.
@@ -2695,20 +2701,20 @@
     _see_also = ['status', 'ignored', 'patterns']
     takes_args = ['name_pattern*']
     takes_options = [
-        Option('old-default-rules',
-               help='Write out the ignore rules bzr < 0.9 always used.')
+        Option('default-rules',
+               help='Display the default ignore rules that bzr uses.')
         ]
 
-    def run(self, name_pattern_list=None, old_default_rules=None):
+    def run(self, name_pattern_list=None, default_rules=None):
         from bzrlib import ignores
-        if old_default_rules is not None:
-            # dump the rules and exit
-            for pattern in ignores.OLD_DEFAULTS:
+        if default_rules is not None:
+            # dump the default rules and exit
+            for pattern in ignores.USER_DEFAULTS:
                 self.outf.write("%s\n" % pattern)
             return
         if not name_pattern_list:
             raise errors.BzrCommandError("ignore requires at least one "
-                                  "NAME_PATTERN or --old-default-rules")
+                "NAME_PATTERN or --default-rules.")
         name_pattern_list = [globbing.normalize_pattern(p)
                              for p in name_pattern_list]
         for name_pattern in name_pattern_list:

=== modified file 'bzrlib/ignores.py'
--- a/bzrlib/ignores.py	2010-03-29 00:54:27 +0000
+++ b/bzrlib/ignores.py	2010-04-22 12:54:41 +0000
@@ -27,66 +27,6 @@
 
 from trace import warning
 
-# This was the full ignore list for bzr 0.8
-# please keep these sorted (in C locale order) to aid merging
-OLD_DEFAULTS = [
-    '#*#',
-    '*$',
-    '*,v',
-    '*.BAK',
-    '*.a',
-    '*.bak',
-    '*.elc',
-    '*.exe',
-    '*.la',
-    '*.lo',
-    '*.o',
-    '*.obj',
-    '*.orig',
-    '*.py[oc]',
-    '*.so',
-    '*.tmp',
-    '*~',
-    '.#*',
-    '.*.sw[nop]',
-    '.*.tmp',
-    # Our setup tests dump .python-eggs in the bzr source tree root
-    './.python-eggs',
-    '.DS_Store',
-    '.arch-ids',
-    '.arch-inventory',
-    '.bzr.log',
-    '.del-*',
-    '.git',
-    '.hg',
-    '.jamdeps'
-    '.libs',
-    '.make.state',
-    '.sconsign*',
-    '.svn',
-    '.sw[nop]',    # vim editing nameless file
-    '.tmp*',
-    'BitKeeper',
-    'CVS',
-    'CVS.adm',
-    'RCS',
-    'SCCS',
-    'TAGS',
-    '_darcs',
-    'aclocal.m4',
-    'autom4te*',
-    'config.h',
-    'config.h.in',
-    'config.log',
-    'config.status',
-    'config.sub',
-    'stamp-h',
-    'stamp-h.in',
-    'stamp-h1',
-    '{arch}',
-]
-
-
 # ~/.bazaar/ignore will be filled out using
 # this ignore list, if it does not exist
 # please keep these sorted (in C locale order) to aid merging

=== modified file 'bzrlib/tests/blackbox/test_ignore.py'
--- a/bzrlib/tests/blackbox/test_ignore.py	2010-02-17 17:11:16 +0000
+++ b/bzrlib/tests/blackbox/test_ignore.py	2010-04-22 12:45:03 +0000
@@ -106,12 +106,14 @@
         """'ignore' with no arguments returns an error"""
         self.make_branch_and_tree('.')
         self.run_bzr_error(('bzr: ERROR: ignore requires at least one '
-                            'NAME_PATTERN or --old-default-rules\n',),
+                            'NAME_PATTERN or --default-rules.\n',),
                            'ignore')
 
-    def test_ignore_old_defaults(self):
-        out, err = self.run_bzr('ignore --old-default-rules')
-        self.assertContainsRe(out, 'CVS')
+    def test_ignore_default_rules(self):
+        out, err = self.run_bzr(['ignore', '--default-rules'])
+        reference_set = set(ignores.USER_DEFAULTS)
+        output_set = set(out.rstrip().split('\n'))
+        self.assertEqual(reference_set, output_set)
         self.assertEqual('', err)
 
     def test_ignore_versioned_file(self):




More information about the bazaar-commits mailing list