~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-02-28 10:06:39 UTC
  • mfrom: (6437.40.2 rmbranch-colo)
  • mto: This revision was merged to the branch mainline in revision 6482.
  • Revision ID: jelmer@samba.org-20120228100639-p5gndu91wuqwugti
Merge rmbranch-colo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
 
128
128
    def test_double_binding(self):
129
129
        child_tree = self.create_branches()[1]
130
 
 
131
 
        child2_tree = child_tree.bzrdir.sprout('child2').open_workingtree()
 
130
        child_tree.bzrdir.sprout('child2')
132
131
 
133
132
        # Double binding succeeds, but committing to child2 should fail
134
133
        self.run_bzr('bind ../child', working_dir='child2')
135
134
 
 
135
        # Refresh the child tree object as 'unbind' modified it
 
136
        child2_tree = bzrdir.BzrDir.open('child2').open_workingtree()
136
137
        self.assertRaises(errors.CommitToDoubleBoundBranch,
137
138
                child2_tree.commit, message='child2', allow_pointless=True)
138
139
 
150
151
        self.run_bzr("commit -m child", retcode=3, working_dir='child')
151
152
        self.check_revno(1, 'child')
152
153
        self.run_bzr('unbind', working_dir='child')
 
154
        # Refresh the child tree/branch objects as 'unbind' modified them
 
155
        child_tree = child_tree.bzrdir.open_workingtree()
153
156
        child_tree.commit(message='child')
154
157
        self.check_revno(2, 'child')
155
158
 
200
203
 
201
204
        self.run_bzr('unbind', working_dir='child')
202
205
 
 
206
        # Refresh the child tree/branch objects as 'unbind' modified them
 
207
        child_tree = child_tree.bzrdir.open_workingtree()
203
208
        child_tree.commit(message='child', allow_pointless=True)
204
209
        self.check_revno(2, 'child')
205
210
 
210
215
        # These branches have diverged, but bind should succeed anyway
211
216
        self.run_bzr('bind ../base', working_dir='child')
212
217
 
 
218
        # Refresh the child tree/branch objects as 'bind' modified them
 
219
        child_tree = child_tree.bzrdir.open_workingtree()
213
220
        # This should turn the local commit into a merge
214
221
        child_tree.update()
215
222
        child_tree.commit(message='merged')
248
255
        child_tree = self.create_branches()[1]
249
256
 
250
257
        self.run_bzr('unbind', working_dir='child')
 
258
        # Refresh the child tree/branch objects as 'bind' modified them
 
259
        child_tree = child_tree.bzrdir.open_workingtree()
251
260
        child_tree.commit(message='child', allow_pointless=True)
252
261
        self.check_revno(2, 'child')
253
262
        self.check_revno(1, 'base')