/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 breezy/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2018-03-24 17:48:04 UTC
  • mfrom: (6921 work)
  • mto: This revision was merged to the branch mainline in revision 6923.
  • Revision ID: jelmer@jelmer.uk-20180324174804-xf22o05byoj12x1q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1959
1959
            os.chdir(working_dir)
1960
1960
 
1961
1961
        try:
1962
 
            result = self.apply_redirected(
1963
 
                ui.ui_factory.stdin,
1964
 
                stdout, stderr,
1965
 
                _mod_commands.run_bzr_catch_user_errors,
1966
 
                args)
 
1962
            with ui.ui_factory:
 
1963
                result = self.apply_redirected(
 
1964
                    ui.ui_factory.stdin,
 
1965
                    stdout, stderr,
 
1966
                    _mod_commands.run_bzr_catch_user_errors,
 
1967
                    args)
1967
1968
        finally:
1968
1969
            logger.removeHandler(handler)
1969
1970
            ui.ui_factory = old_ui_factory
2693
2694
    def make_branch_and_memory_tree(self, relpath, format=None):
2694
2695
        """Create a branch on the default transport and a MemoryTree for it."""
2695
2696
        b = self.make_branch(relpath, format=format)
2696
 
        return memorytree.MemoryTree.create_on_branch(b)
 
2697
        return b.create_memorytree()
2697
2698
 
2698
2699
    def make_branch_builder(self, relpath, format=None):
2699
2700
        branch = self.make_branch(relpath, format=format)
2865
2866
            for p in path:
2866
2867
                self.assertInWorkingTree(p, tree=tree)
2867
2868
        else:
2868
 
            self.assertIsNot(tree.path2id(path), None,
 
2869
            self.assertTrue(tree.is_versioned(path),
2869
2870
                path+' not in working tree.')
2870
2871
 
2871
2872
    def assertNotInWorkingTree(self, path, root_path='.', tree=None):
2876
2877
            for p in path:
2877
2878
                self.assertNotInWorkingTree(p, tree=tree)
2878
2879
        else:
2879
 
            self.assertIs(tree.path2id(path), None, path+' in working tree.')
 
2880
            self.assertFalse(tree.is_versioned(path), path+' in working tree.')
2880
2881
 
2881
2882
 
2882
2883
class TestCaseWithTransport(TestCaseInTempDir):