~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009 Canonical Ltd
 
1
# Copyright (C) 2007-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
242
242
        branch_2 = tree_2.branch
243
243
        # now reconfigure to be stacked
244
244
        out, err = self.run_bzr('reconfigure --stacked-on b1 b2')
245
 
        self.assertContainsRe(out,
246
 
            '^.*/b2/ is now stacked on ../b1\n$')
 
245
        self.assertContainsRe(out, '^.*/b2/ is now stacked on ../b1\n$')
247
246
        self.assertEquals('', err)
248
247
        # can also give the absolute URL of the branch, and it gets stored 
249
248
        # as a relative path if possible
250
249
        out, err = self.run_bzr('reconfigure --stacked-on %s b2'
251
 
            % (self.get_url('b1'),))
252
 
        self.assertContainsRe(out,
253
 
            '^.*/b2/ is now stacked on ../b1\n$')
 
250
                                % (self.get_url('b1'),))
 
251
        self.assertContainsRe(out, '^.*/b2/ is now stacked on ../b1\n$')
254
252
        self.assertEquals('', err)
 
253
        # Refresh the branch as 'reconfigure' modified it
 
254
        branch_2 = branch_2.bzrdir.open_branch()
255
255
        # It should be given a relative URL to the destination, if possible,
256
256
        # because that's most likely to work across different transports
257
 
        self.assertEquals(branch_2.get_stacked_on_url(),
258
 
            '../b1')
 
257
        self.assertEquals('../b1', branch_2.get_stacked_on_url())
259
258
        # commit, and it should be stored into b2's repo
260
259
        self.build_tree_contents([('foo', 'new foo')])
261
260
        tree_2.commit('update foo')
264
263
        self.assertContainsRe(out,
265
264
            '^.*/b2/ is now not stacked\n$')
266
265
        self.assertEquals('', err)
267
 
        self.assertRaises(errors.NotStacked,
268
 
            branch_2.get_stacked_on_url)
 
266
        # Refresh the branch as 'reconfigure' modified it
 
267
        branch_2 = branch_2.bzrdir.open_branch()
 
268
        self.assertRaises(errors.NotStacked, branch_2.get_stacked_on_url)
269
269
 
270
270
    # XXX: Needs a test for reconfiguring stacking and shape at the same time;
271
271
    # no branch at location; stacked-on is not a branch; quiet mode.