~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_workingtree.py

  • Committer: Robert Collins
  • Date: 2006-03-05 02:20:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: robertc@robertcollins.net-20060305022007-53e5907d083453e8
Local commits appear to be working properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
448
448
        tree.update()
449
449
        self.assertEqual('foo', tree.last_revision())
450
450
        self.assertEqual('foo', tree.branch.last_revision())
 
451
 
 
452
    def test_update_turns_local_commit_into_merge(self):
 
453
        # doing an update with a few local commits and no master commits
 
454
        # makes pending-merges.
 
455
        master_tree = self.make_branch_and_tree('master')
 
456
        tree = self.make_branch_and_tree('tree')
 
457
        try:
 
458
            tree.branch.bind(master_tree.branch)
 
459
        except errors.UpgradeRequired:
 
460
            # legacy branches cannot bind
 
461
            return
 
462
        tree.commit('foo', rev_id='foo', allow_pointless=True, local=True)
 
463
        tree.commit('bar', rev_id='bar', allow_pointless=True, local=True)
 
464
        tree.update()
 
465
        self.assertEqual(None, tree.last_revision())
 
466
        self.assertEqual([], tree.branch.revision_history())
 
467
        self.assertEqual(['bar'], tree.pending_merges())
 
468