~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-01-23 19:08:05 UTC
  • mfrom: (6437.3.20 2.5)
  • mto: This revision was merged to the branch mainline in revision 6450.
  • Revision ID: jelmer@samba.org-20120123190805-hlcuihkt2dep44cw
merge bzr 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2009-2012 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
44
44
    def prepare_merge_directive(self):
45
45
        self.tree1 = self.make_branch_and_tree('tree1')
46
46
        self.build_tree_contents([('tree1/file', 'a\nb\nc\nd\n')])
47
 
        self.tree1.branch.get_config().set_user_option('email',
48
 
            'J. Random Hacker <jrandom@example.com>')
 
47
        self.tree1.branch.get_config_stack().set(
 
48
            'email', 'J. Random Hacker <jrandom@example.com>')
49
49
        self.tree1.add('file')
50
50
        self.tree1.commit('foo', rev_id='foo-id')
51
51
        self.tree2 = self.tree1.bzrdir.sprout('tree2').open_workingtree()
223
223
 
224
224
    def test_mail_uses_config(self):
225
225
        tree1, tree2 = self.prepare_merge_directive()
226
 
        tree1.branch.get_config().set_user_option('smtp_server', 'bogushost')
 
226
        tree1.branch.get_config_stack().set('smtp_server', 'bogushost')
227
227
        md_text, errr, connect_calls, sendmail_calls =\
228
228
            self.run_bzr_fakemail('merge-directive --mail-to'
229
229
                                  ' pqm@example.com --plain ../tree2 .')
234
234
        foo = self.make_branch_and_tree('foo')
235
235
        foo.commit('rev1')
236
236
        bar = self.make_branch_and_tree('bar')
237
 
        os.chdir('foo')
238
 
        self.run_bzr('merge-directive ../bar')
 
237
        self.run_bzr('merge-directive ../bar', working_dir='foo')
239
238
 
240
239
    def test_no_commits(self):
241
240
        foo = self.make_branch_and_tree('foo')
242
241
        bar = self.make_branch_and_tree('bar')
243
 
        os.chdir('foo')
244
242
        self.run_bzr_error(('No revisions to bundle.', ),
245
 
                            'merge-directive ../bar')
 
243
                            'merge-directive ../bar', working_dir='foo')
246
244
 
247
245
    def test_encoding_exact(self):
248
246
        tree1, tree2 = self.prepare_merge_directive()