~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

  • Committer: Robert Collins
  • Date: 2005-10-02 23:23:56 UTC
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20051002232355-345a7837be0298c8
reenable pending merge tests in testbranch.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        br.append_revision("rev2", "rev3")
34
34
        self.assertEquals(br.revision_history(), ["rev1", "rev2", "rev3"])
35
35
 
36
 
 
37
 
class TestFetch(TestCaseInTempDir):
38
 
 
39
36
    def test_fetch_revisions(self):
40
37
        """Test fetch-revision operation."""
41
38
        from bzrlib.fetch import Fetcher
119
116
#     an identical tree without a ghost
120
117
# fetch missing should rewrite the TOC of weaves to list newly available parents.
121
118
        
 
119
    def test_pending_merges(self):
 
120
        """Tracking pending-merged revisions."""
 
121
        b = Branch.initialize('.')
 
122
 
 
123
        self.assertEquals(b.pending_merges(), [])
 
124
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
 
125
        self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
 
126
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
 
127
        self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
 
128
        b.add_pending_merge('wibble@fofof--20050401--1928390812')
 
129
        self.assertEquals(b.pending_merges(),
 
130
                          ['foo@azkhazan-123123-abcabc',
 
131
                           'wibble@fofof--20050401--1928390812'])
 
132
        b.commit("commit from base with two merges")
 
133
        rev = b.get_revision(b.revision_history()[0])
 
134
        self.assertEquals(len(rev.parent_ids), 2)
 
135
        self.assertEquals(rev.parent_ids[0],
 
136
                          'foo@azkhazan-123123-abcabc')
 
137
        self.assertEquals(rev.parent_ids[1],
 
138
                           'wibble@fofof--20050401--1928390812')
 
139
        # list should be cleared when we do a commit
 
140
        self.assertEquals(b.pending_merges(), [])
 
141
 
 
142
 
122
143
# TODO: rewrite this as a regular unittest, without relying on the displayed output        
123
144
#         >>> from bzrlib.commit import commit
124
145
#         >>> bzrlib.trace.silent = True