~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-07-19 21:44:16 UTC
  • mfrom: (1836.1.26 ignores)
  • Revision ID: pqm@pqm.ubuntu.com-20060719214416-9fab2f627df9f1aa
(jam) allow global user ignores, and include a small set by default

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from cStringIO import StringIO
19
19
import os
20
20
 
 
21
from bzrlib import ignores
21
22
import bzrlib
22
23
from bzrlib.branch import Branch
23
24
from bzrlib import bzrdir, conflicts, errors, workingtree
314
315
 
315
316
    def test__get_ignore_rules_as_regex(self):
316
317
        tree = self.make_branch_and_tree('.')
317
 
        self.build_tree_contents([('.bzrignore', 'CVS\n.hg\n')])
318
 
        reference_output = tree._combine_ignore_rules(['CVS', '.hg'])[0]
319
 
        regex_rules = tree._get_ignore_rules_as_regex()[0]
320
 
        self.assertEqual(len(reference_output[1]), regex_rules[0].groups)
321
 
        self.assertEqual(reference_output[1], regex_rules[1])
 
318
        # Setup the default ignore list to be empty
 
319
        ignores.set_user_ignores([])
 
320
 
 
321
        # some plugins (shelf) modifies the DEFAULT_IGNORE list in memory
 
322
        # which causes this test to fail so force the DEFAULT_IGNORE
 
323
        # list to be empty
 
324
        orig_default = bzrlib.DEFAULT_IGNORE
 
325
        try:
 
326
            bzrlib.DEFAULT_IGNORE = []
 
327
            self.build_tree_contents([('.bzrignore', 'CVS\n.hg\n')])
 
328
            reference_output = tree._combine_ignore_rules(['CVS', '.hg'])[0]
 
329
            regex_rules = tree._get_ignore_rules_as_regex()[0]
 
330
            self.assertEqual(len(reference_output[1]), regex_rules[0].groups)
 
331
            self.assertEqual(reference_output[1], regex_rules[1])
 
332
        finally:
 
333
            bzrlib.DEFAULT_IGNORE = orig_default