def tearDown(self): osutils._cached_user_encoding = self.old_user_encoding if hasattr(bzrlib, 'user_encoding'): bzrlib.user_encoding = self.old_user_encoding osutils._cached_user_encoding = self.old_user_encoding osutils.get_user_encoding = self.old_get_user_encoding sys.stdout = self.stdout TestCaseWithTransport.tearDown(self)
def setUp(self): TestCaseWithTransport.setUp(self) tree = self.make_branch_and_tree('.') self.build_tree(['a', 'b/', 'b/c']) tree.add(['a', 'b', 'b/c'], ['a-id', 'b-id', 'c-id']) tree.commit('init', rev_id='one') self.tree = tree
def setUp(self): """Set up tests.""" # These tests assume a branch with five revisions, and # a branch from version 1 containing three revisions # merged at version 2. TestCaseWithTransport.setUp(self) self.tree = self.make_branch_and_tree(".") test_file = open("test_file", "w") test_file.write("one") test_file.close() self.tree.add(self.tree.relpath(os.path.join(os.getcwd(), 'test_file'))) test_file_append = open("test_file_append", "a") test_file_append.write("one\n") test_file_append.close() self.tree.add(self.tree.relpath(os.path.join(os.getcwd(), 'test_file_append'))) self.tree.commit(message = "add test files") BzrDir.open(".").sprout("../temp-clone") clone_bzrdir = BzrDir.open("../temp-clone") clone_tree = clone_bzrdir.open_workingtree() for content in ["one dot one", "one dot two", "one dot three"]: test_file = open("../temp-clone/test_file", "w") test_file.write(content) test_file.close() test_file_append = open("../temp-clone/test_file_append", "a") test_file_append.write(content + "\n") test_file_append.close() clone_tree.commit(message = "make branch test change") saved_subtree_revid = clone_tree.branch.last_revision() self.tree.merge_from_branch(clone_tree.branch) test_file = open("test_file", "w") test_file.write("two") test_file.close() test_file_append = open("test_file_append", "a") test_file_append.write("two\n") test_file_append.close() self.tree.commit(message = "merge external branch") shutil.rmtree("../temp-clone") self.subtree_rev = saved_subtree_revid file_contents = ["three", "four", "five"] for content in file_contents: test_file = open("test_file", "w") test_file.write(content) test_file.close() test_file_append = open("test_file_append", "a") test_file_append.write(content + "\n") test_file_append.close() self.tree.commit(message = "make test change")
def setUp(self): """Set up tests.""" # These tests assume a branch with five revisions, and # a branch from version 1 containing three revisions # merged at version 2. TestCaseWithTransport.setUp(self) self.tree = self.make_branch_and_tree(".") test_file = open("test_file", "w") test_file.write("one") test_file.close() self.tree.add(self.tree.relpath(os.path.join(os.getcwd(), 'test_file'))) test_file_append = open("test_file_append", "a") test_file_append.write("one\n") test_file_append.close() self.tree.add( self.tree.relpath(os.path.join(os.getcwd(), 'test_file_append'))) self.tree.commit(message="add test files") BzrDir.open(".").sprout("../temp-clone") clone_bzrdir = BzrDir.open("../temp-clone") clone_tree = clone_bzrdir.open_workingtree() for content in ["one dot one", "one dot two", "one dot three"]: test_file = open("../temp-clone/test_file", "w") test_file.write(content) test_file.close() test_file_append = open("../temp-clone/test_file_append", "a") test_file_append.write(content + "\n") test_file_append.close() clone_tree.commit(message="make branch test change") saved_subtree_revid = clone_tree.branch.last_revision() self.tree.merge_from_branch(clone_tree.branch) test_file = open("test_file", "w") test_file.write("two") test_file.close() test_file_append = open("test_file_append", "a") test_file_append.write("two\n") test_file_append.close() self.tree.commit(message="merge external branch") shutil.rmtree("../temp-clone") self.subtree_rev = saved_subtree_revid file_contents = ["three", "four", "five"] for content in file_contents: test_file = open("test_file", "w") test_file.write(content) test_file.close() test_file_append = open("test_file_append", "a") test_file_append.write(content + "\n") test_file_append.close() self.tree.commit(message="make test change")
def setUp(self): TestCaseWithTransport.setUp(self) self.br1, self.br2 = make_branches(self) wt1 = self.br1.bzrdir.open_workingtree() wt2 = self.br2.bzrdir.open_workingtree() wt2.commit("Commit eleven", rev_id="b@u-0-7") wt2.commit("Commit twelve", rev_id="b@u-0-8") wt2.commit("Commit thirtteen", rev_id="b@u-0-9") wt1.merge_from_branch(self.br2) wt1.commit("Commit fourtten", rev_id="a@u-0-6") wt2.merge_from_branch(self.br1) wt2.commit("Commit fifteen", rev_id="b@u-0-10")
def setUp(self): TestCaseWithTransport.setUp(self)
def tearDown(self): bzrlib.user_encoding = self.user_encoding sys.stdout = self.stdout TestCaseWithTransport.tearDown(self)
def setUp(self): TestCaseWithTransport.setUp(self) self.old_user_encoding = osutils._cached_user_encoding self.old_get_user_encoding = osutils.get_user_encoding self.stdout = sys.stdout
def setUp(self): TestCaseWithTransport.setUp(self) self._default_label = '2a'
def setUp(self): TestCaseWithTransport.setUp(self) self.hook_log = []
def setUp(self): TestCaseWithTransport.setUp(self) self.user_encoding = bzrlib.user_encoding self.stdout = sys.stdout
def setUp(self): TestCaseWithTransport.setUp(self) self.vfs_transport_factory = MemoryServer if self.transport_server is LocalURLServer: self.transport_server = None
def make_branch_and_tree(self, relpath): format = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree') return TestCaseWithTransport.make_branch_and_tree(self, relpath, format=format)