~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_switch.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-15 04:05:36 UTC
  • mfrom: (4963 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4964.
  • Revision ID: andrew.bennetts@canonical.com-20100115040536-9l6iz5an8tqq9ny7
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007-2010 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
112
112
        tree.commit(rev_id='rev2', message='rev2')
113
113
        # Check it out and switch to revision 1
114
114
        checkout = tree.branch.create_checkout('checkout',
115
 
                                               lightweight=self.lightweight)
 
115
            lightweight=self.lightweight)
116
116
        switch.switch(checkout.bzrdir, tree.branch, revision_id="rev1")
117
117
        self.failUnlessExists('checkout/file-1')
118
118
        self.failIfExists('checkout/file-2')
119
119
 
 
120
    def test_switch_changing_root_id(self):
 
121
        tree = self._setup_tree()
 
122
        tree2 = self.make_branch_and_tree('tree-2')
 
123
        tree2.set_root_id('custom-root-id')
 
124
        self.build_tree(['tree-2/file-2'])
 
125
        tree2.add(['file-2'])
 
126
        tree2.commit('rev1b')
 
127
        checkout = tree.branch.create_checkout('checkout',
 
128
            lightweight=self.lightweight)
 
129
        switch.switch(checkout.bzrdir, tree2.branch)
 
130
        self.assertEqual('custom-root-id', tree2.get_root_id())
 
131
 
120
132
 
121
133
class TestSwitchHeavyweight(TestSwitch):
122
134