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

  • Committer: Gary van der Merwe
  • Date: 2009-01-06 13:03:42 UTC
  • mto: (0.152.55 trunk)
  • mto: This revision was merged to the branch mainline in revision 6649.
  • Revision ID: garyvdm@gmail.com-20090106130342-08eyv52mgbj2mnk6
Push using lower level api to avoid output.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import stat
19
19
import sys
20
20
 
21
 
 
 
21
from cStringIO import StringIO
22
22
from bzrlib import (
23
23
    branch,
24
24
    bzrdir,
29
29
    tests,
30
30
    transport,
31
31
    workingtree,
 
32
    trace,
32
33
    )
33
34
from bzrlib.smart import server as smart_server
34
 
from bzrlib.builtins import cmd_push
 
35
from bzrlib.push import _show_push_branch
35
36
 
36
37
from bzrlib.tests import (
37
38
    test_transport_implementations,
157
158
    def make_local_branch(self):
158
159
        t = transport.get_transport('branch')
159
160
        t.ensure_base()
160
 
        branch = bzrdir.BzrDir.create_branch_convenience(
 
161
        self.branch = bzrdir.BzrDir.create_branch_convenience(
161
162
            t.base,
162
163
            format=bzrdir.format_registry.make_bzrdir('default'),
163
164
            force_new_tree=False)
164
 
        self.tree = branch.bzrdir.create_workingtree()
 
165
        self.tree = self.branch.bzrdir.create_workingtree()
165
166
        self.tree.commit('initial empty tree')
166
167
 
167
168
    def assertUpFileEqual(self, content, path, base=upload_dir):
565
566
    def do_full_upload(self, *args, **kwargs):
566
567
        up_url = self.get_transport(self.upload_dir).external_url()
567
568
        
568
 
        push = cmd_push()
569
 
        push._setup_outf()
570
 
        push.run(location=up_url, directory='branch')
 
569
        rev_id = self.branch.last_revision()
 
570
        output = StringIO()
 
571
        _show_push_branch(self.branch, rev_id, up_url, output)
571
572
        
572
573
        upload = self._get_cmd_upload()
573
574
        if kwargs.get('directory', None) is None:
579
580
    def do_incremental_upload(self, *args, **kwargs):
580
581
        up_url = self.get_transport(self.upload_dir).external_url()
581
582
        
582
 
        push = cmd_push()
583
 
        push._setup_outf()
584
 
        push.run(location=up_url, directory='branch')
 
583
        rev_id = self.branch.last_revision()
 
584
        output = StringIO()
 
585
        _show_push_branch(self.branch, rev_id, up_url, output)
585
586
        
586
587
        upload = self._get_cmd_upload()
587
588
        if kwargs.get('directory', None) is None: