예제 #1
0
    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
예제 #2
0
파일: tests.py 프로젝트: fmccann/bzr-bisect
    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")
예제 #3
0
    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
예제 #4
0
파일: tests.py 프로젝트: fmccann/bzr-bisect
    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")
예제 #5
0
    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")
예제 #6
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
예제 #7
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
     self.vfs_transport_factory = MemoryServer
     if self.transport_server is LocalURLServer:
         self.transport_server = None
예제 #8
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
     self._default_label = '2a'
예제 #9
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
     self.user_encoding = bzrlib.user_encoding
     self.stdout = sys.stdout
예제 #10
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
예제 #11
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
     self.user_encoding = bzrlib.user_encoding
     self.stdout = sys.stdout
예제 #12
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
     self.vfs_transport_factory = MemoryServer
     if self.transport_server is LocalURLServer:
         self.transport_server = None
예제 #13
0
 def setUp(self):
     TestCaseWithTransport.setUp(self)
     self.hook_log = []
예제 #14
0
 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
예제 #15
0
 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