/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_version_info.py

  • Committer: Vincent Ladeuil
  • Date: 2009-09-08 16:45:11 UTC
  • mto: (4681.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4682.
  • Revision ID: v.ladeuil+lp@free.fr-20090908164511-5e7eupewxycwaue4
Don't allow remove-tree to succeed with pending merges unless
--force is used.

* bzrlib/tests/blackbox/test_remove_tree.py:
(TestRemoveTree.test_remove_tree_pending_merges,
TestRemoveTree.test_remove_tree_pending_merges_force): Test with
and without --force and pending merges.

* bzrlib/builtins.py:
(cmd_remove_tree.run): Check pending merges too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from bzrlib import (
25
25
    errors,
26
 
    registry,
27
26
    symbol_versioning,
28
27
    tests,
29
28
    version_info_formats,
326
325
 
327
326
    def setUp(self):
328
327
        super(TestVersionInfoFormatRegistry, self).setUp()
329
 
        self.overrideAttr(version_info_formats,
330
 
                          'format_registry', registry.Registry())
 
328
        registry = version_info_formats.format_registry
 
329
        self._default_key = registry._default_key
 
330
        self._dict = registry._dict.copy()
 
331
        self._help_dict = registry._help_dict.copy()
 
332
        self._info_dict = registry._info_dict.copy()
 
333
        self.addCleanup(self._cleanup)
 
334
 
 
335
    def _cleanup(self):
 
336
        # Restore the registry to pristine state after the test runs
 
337
        registry = version_info_formats.format_registry
 
338
        registry._default_key = self._default_key
 
339
        registry._dict = self._dict
 
340
        registry._help_dict = self._help_dict
 
341
        registry._info_dict = self._info_dict
331
342
 
332
343
    def test_register_remove(self):
333
344
        registry = version_info_formats.format_registry