~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_send.py

  • Committer: Patch Queue Manager
  • Date: 2012-02-14 18:29:43 UTC
  • mfrom: (6404.6.11 cached-branch-store)
  • Revision ID: pqm@pqm.ubuntu.com-20120214182943-vso6j0mqdnxfkp7s
(vila) Cache the branch config store to avoid useless IOs. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2012 Canonical Ltd
2
2
# Authors: Aaron Bentley
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
230
230
                            'send -f branch -o- --format=0.999')[0]
231
231
 
232
232
    def test_format_child_option(self):
233
 
        parent_config = branch.Branch.open('parent').get_config_stack()
234
 
        parent_config.set('child_submit_format', '4')
 
233
        br = branch.Branch.open('parent')
 
234
        conf = br.get_config_stack()
 
235
        conf.set('child_submit_format', '4')
235
236
        md = self.get_MD([])
236
237
        self.assertIs(merge_directive.MergeDirective2, md.__class__)
237
238
 
238
 
        parent_config.set('child_submit_format', '0.9')
 
239
        conf.set('child_submit_format', '0.9')
239
240
        md = self.get_MD([])
240
241
        self.assertFormatIs('# Bazaar revision bundle v0.9', md)
241
242
 
243
244
        self.assertFormatIs('# Bazaar revision bundle v0.9', md)
244
245
        self.assertIs(merge_directive.MergeDirective, md.__class__)
245
246
 
246
 
        parent_config.set('child_submit_format', '0.999')
 
247
        conf.set('child_submit_format', '0.999')
247
248
        self.run_bzr_error(["No such send format '0.999'"],
248
249
                            'send -f branch -o-')[0]
249
250
 
293
294
    _default_additional_warning = 'Uncommitted changes will not be sent.'
294
295
 
295
296
    def set_config_send_strict(self, value):
296
 
        # set config var (any of bazaar.conf, locations.conf, branch.conf
297
 
        # should do)
298
 
        conf = self.local_tree.branch.get_config_stack()
299
 
        conf.set('send_strict', value)
 
297
        br = branch.Branch.open('local')
 
298
        br.get_config_stack().set('send_strict', value)
300
299
 
301
300
    def assertSendFails(self, args):
302
301
        out, err = self.run_send(args, rc=3, err_re=self._default_errors)
463
462
        # being too low. If rpc_count increases, more network roundtrips have
464
463
        # become necessary for this use case. Please do not adjust this number
465
464
        # upwards without agreement from bzr's network support maintainers.
466
 
        self.assertLength(9, self.hpss_calls)
 
465
        self.assertLength(7, self.hpss_calls)
467
466
        self.assertLength(1, self.hpss_connections)
468
467
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)