/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Lukáš Lalinský
  • Date: 2007-12-17 17:28:25 UTC
  • mfrom: (3120 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3123.
  • Revision ID: lalinsky@gmail.com-20071217172825-tr3pqm1mhvs3gwnn
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
        child_tree.commit(message='child')
199
199
        self.check_revno(2)
200
200
 
201
 
        self.run_bzr('bind', retcode=3)
202
 
 
203
201
    def test_commit_remote_bound(self):
204
202
        # It is not possible to commit to a branch
205
203
        # which is bound to a branch which is bound
247
245
        self.check_revno(2, 'base')
248
246
 
249
247
        os.chdir('child')
250
 
        # These branches have diverged
251
 
        self.run_bzr('bind ../base', retcode=3)
 
248
        # These branches have diverged, but bind should succeed anyway
 
249
        self.run_bzr('bind ../base')
252
250
 
253
 
        # TODO: In the future, this might require actual changes
254
 
        # to have occurred, rather than just a new revision entry
255
 
        child_tree.merge_from_branch(base_branch)
 
251
        # This should turn the local commit into a merge
 
252
        child_tree.update()
256
253
        child_tree.commit(message='merged')
257
254
        self.check_revno(3)
258
255
 
261
258
        base_history = base_branch.revision_history()
262
259
        child_history = child_branch.revision_history()
263
260
 
264
 
        # After a merge, trying to bind again should succeed
265
 
        # keeping the new change as a local commit.
266
 
        self.run_bzr('bind ../base')
267
 
        self.check_revno(3)
268
 
        self.check_revno(2, '../base')
269
 
 
270
 
        # and compare the revision history now
271
 
        self.assertEqual(base_history, base_branch.revision_history())
272
 
        self.assertEqual(child_history, child_branch.revision_history())
273
 
 
274
261
    def test_bind_parent_ahead(self):
275
262
        base_tree = self.create_branches()[0]
276
263
 
322
309
        self.run_bzr('bind ../base')
323
310
        self.check_revno(1, '../base')
324
311
 
 
312
    def test_bind_fail_if_missing(self):
 
313
        """We should not be able to bind to a missing branch."""
 
314
        tree = self.make_branch_and_tree('tree_1')
 
315
        tree.commit('dummy commit')
 
316
        self.run_bzr_error(['Not a branch.*no-such-branch/'], ['bind', '../no-such-branch'],
 
317
                            working_dir='tree_1')
 
318
        self.assertIs(None, tree.branch.get_bound_location())
 
319
 
325
320
    def test_commit_after_merge(self):
326
321
        base_tree, child_tree = self.create_branches()
327
322