/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-07-21 04:10:42 UTC
  • mfrom: (1836.1.31 ignores)
  • Revision ID: pqm@pqm.ubuntu.com-20060721041042-03dad3286bcc99ed
(jam) add bzrlib.ignores.add_runtime_ignores, for plugins that want to use it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
    def test__get_ignore_rules_as_regex(self):
344
344
        tree = self.make_branch_and_tree('.')
345
345
        # Setup the default ignore list to be empty
346
 
        ignores.set_user_ignores([])
 
346
        ignores._set_user_ignores([])
347
347
 
348
348
        # some plugins (shelf) modifies the DEFAULT_IGNORE list in memory
349
349
        # which causes this test to fail so force the DEFAULT_IGNORE
350
350
        # list to be empty
351
351
        orig_default = bzrlib.DEFAULT_IGNORE
 
352
        # Also make sure the runtime ignore list is empty
 
353
        orig_runtime = ignores._runtime_ignores
352
354
        try:
353
355
            bzrlib.DEFAULT_IGNORE = []
 
356
            ignores._runtime_ignores = set()
 
357
 
354
358
            self.build_tree_contents([('.bzrignore', 'CVS\n.hg\n')])
355
 
            reference_output = tree._combine_ignore_rules(['CVS', '.hg'])[0]
 
359
            reference_output = tree._combine_ignore_rules(
 
360
                                    set(['CVS', '.hg']))[0]
356
361
            regex_rules = tree._get_ignore_rules_as_regex()[0]
357
362
            self.assertEqual(len(reference_output[1]), regex_rules[0].groups)
358
363
            self.assertEqual(reference_output[1], regex_rules[1])
359
364
        finally:
360
365
            bzrlib.DEFAULT_IGNORE = orig_default
 
366
            ignores._runtime_ignores = orig_runtime