~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

  • Committer: Robert Collins
  • Date: 2005-11-06 00:12:04 UTC
  • mfrom: (1457.1.16)
  • Revision ID: robertc@robertcollins.net-20051106001204-b8c6d5169308d7e6
All pending merges operations from Branch are now on WorkingTree.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
    def test_record_initial_ghost_merge(self):
130
130
        """A pending merge with no revision present is still a merge."""
131
131
        branch = Branch.initialize('.')
132
 
        branch.add_pending_merge('non:existent@rev--ision--0--2')
 
132
        branch.working_tree().add_pending_merge('non:existent@rev--ision--0--2')
133
133
        branch.commit('pretend to merge nonexistent-revision', rev_id='first')
134
134
        rev = branch.get_revision(branch.last_revision())
135
135
        self.assertEqual(len(rev.parent_ids), 1)
149
149
    def test_pending_merges(self):
150
150
        """Tracking pending-merged revisions."""
151
151
        b = Branch.initialize('.')
152
 
 
153
 
        self.assertEquals(b.pending_merges(), [])
154
 
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
155
 
        self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
156
 
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
157
 
        self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
158
 
        b.add_pending_merge('wibble@fofof--20050401--1928390812')
159
 
        self.assertEquals(b.pending_merges(),
 
152
        wt = b.working_tree()
 
153
        self.assertEquals(wt.pending_merges(), [])
 
154
        wt.add_pending_merge('foo@azkhazan-123123-abcabc')
 
155
        self.assertEquals(wt.pending_merges(), ['foo@azkhazan-123123-abcabc'])
 
156
        wt.add_pending_merge('foo@azkhazan-123123-abcabc')
 
157
        self.assertEquals(wt.pending_merges(), ['foo@azkhazan-123123-abcabc'])
 
158
        wt.add_pending_merge('wibble@fofof--20050401--1928390812')
 
159
        self.assertEquals(wt.pending_merges(),
160
160
                          ['foo@azkhazan-123123-abcabc',
161
161
                           'wibble@fofof--20050401--1928390812'])
162
162
        b.commit("commit from base with two merges")
167
167
        self.assertEquals(rev.parent_ids[1],
168
168
                           'wibble@fofof--20050401--1928390812')
169
169
        # list should be cleared when we do a commit
170
 
        self.assertEquals(b.pending_merges(), [])
 
170
        self.assertEquals(wt.pending_merges(), [])
171
171
 
172
172
    def test_sign_existing_revision(self):
173
173
        branch = Branch.initialize('.')