コード例 #1
0
ファイル: bench_bundle.py プロジェクト: c0ns0le/cygwin
 def _time_read_write(self):
     branch, relpath = Branch.open_containing("a")
     revision_history = branch.revision_history()
     bundle_text = StringIO()
     write_bundle(branch.repository, revision_history[-1],
                  NULL_REVISION, bundle_text)
     bundle_text.seek(0)
     target_tree = self.make_branch_and_tree('b')
     bundle = self.time(read_bundle, bundle_text)
     self.time(install_bundle, target_tree.branch.repository, bundle)
コード例 #2
0
ファイル: bench_bundle.py プロジェクト: saminigod/cygwin
 def _time_read_write(self):
     branch, relpath = Branch.open_containing("a")
     revision_history = branch.revision_history()
     bundle_text = StringIO()
     write_bundle(branch.repository, revision_history[-1], NULL_REVISION,
                  bundle_text)
     bundle_text.seek(0)
     target_tree = self.make_branch_and_tree('b')
     bundle = self.time(read_bundle, bundle_text)
     self.time(install_bundle, target_tree.branch.repository, bundle)
コード例 #3
0
ファイル: request.py プロジェクト: saminigod/cygwin
 def do(self, path, revision_id):
     # open transport relative to our base
     t = self.transport_from_client_path(path)
     control, extra_path = bzrdir.BzrDir.open_containing_from_transport(t)
     repo = control.open_repository()
     tmpf = tempfile.TemporaryFile()
     base_revision = revision.NULL_REVISION
     write_bundle(repo, revision_id, base_revision, tmpf)
     tmpf.seek(0)
     return SuccessfulSmartServerResponse((), tmpf.read())
コード例 #4
0
ファイル: bench_bundle.py プロジェクト: c0ns0le/cygwin
    def test_apply_bundle_known_kernel_like_tree(self):
        """Create a bundle for a kernel sized tree with no ignored, unknowns,
        or added and one commit.
        """ 
        tree = self.make_kernel_like_committed_tree('tree')

        f = open('bundle', 'wb')
        try:
            write_bundle(tree.branch.repository, tree.last_revision(),
                         NULL_REVISION, f)
        finally:
            f.close()

        tree2 = self.make_branch_and_tree('branch_a')
        os.chdir('branch_a')
        self.time(self.run_bzr, ['merge', '../bundle'])
コード例 #5
0
ファイル: bench_bundle.py プロジェクト: saminigod/cygwin
    def test_apply_bundle_known_kernel_like_tree(self):
        """Create a bundle for a kernel sized tree with no ignored, unknowns,
        or added and one commit.
        """
        tree = self.make_kernel_like_committed_tree('tree')

        f = open('bundle', 'wb')
        try:
            write_bundle(tree.branch.repository, tree.last_revision(),
                         NULL_REVISION, f)
        finally:
            f.close()

        tree2 = self.make_branch_and_tree('branch_a')
        os.chdir('branch_a')
        self.time(self.run_bzr, ['merge', '../bundle'])
コード例 #6
0
def create_bundle_file(test_case):
    test_case.build_tree(['tree/', 'tree/a', 'tree/subdir/'])

    format = bzrlib.bzrdir.BzrDirFormat.get_default_format()

    bzrdir = format.initialize('tree')
    repo = bzrdir.create_repository()
    branch = repo.bzrdir.create_branch()
    wt = branch.bzrdir.create_workingtree()

    wt.add(['a', 'subdir/'])
    wt.commit('new project', rev_id='commit-1')

    out = cStringIO.StringIO()
    rev_ids = write_bundle(wt.branch.repository,
                           wt.get_parent_ids()[0], 'null:', out)
    out.seek(0)
    return out, wt
コード例 #7
0
ファイル: test_read_bundle.py プロジェクト: c0ns0le/cygwin
def create_bundle_file(test_case):
    test_case.build_tree(['tree/', 'tree/a', 'tree/subdir/'])

    format = bzrlib.bzrdir.BzrDirFormat.get_default_format()

    bzrdir = format.initialize('tree')
    repo = bzrdir.create_repository()
    branch = repo.bzrdir.create_branch()
    wt = branch.bzrdir.create_workingtree()

    wt.add(['a', 'subdir/'])
    wt.commit('new project', rev_id='commit-1')

    out = cStringIO.StringIO()
    rev_ids = write_bundle(wt.branch.repository,
                           wt.get_parent_ids()[0], 'null:', out)
    out.seek(0)
    return out, wt
コード例 #8
0
ファイル: merge_directive.py プロジェクト: c0ns0le/cygwin
 def _generate_bundle(repository, revision_id, ancestor_id):
     s = StringIO()
     bundle_serializer.write_bundle(repository, revision_id,
                                    ancestor_id, s, '0.9')
     return s.getvalue()
コード例 #9
0
 def _generate_bundle(repository, revision_id, ancestor_id):
     s = StringIO()
     bundle_serializer.write_bundle(repository, revision_id, ancestor_id, s,
                                    '0.9')
     return s.getvalue()