33
33
br.append_revision("rev2", "rev3")
34
34
self.assertEquals(br.revision_history(), ["rev1", "rev2", "rev3"])
37
class TestFetch(TestCaseInTempDir):
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.
119
def test_pending_merges(self):
120
"""Tracking pending-merged revisions."""
121
b = Branch.initialize('.')
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(), [])
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