91
91
"""Find intermediate revisions, without requiring history"""
92
from bzrlib.errors import NotAncestor, NoSuchRevision
92
93
assert len(self.intervene('a@u-0-0', 'a@u-0-0')) == 0
93
94
self.assertEqual(self.intervene('a@u-0-0', 'a@u-0-1'), ['a@u-0-1'])
94
95
self.assertEqual(self.intervene('a@u-0-0', 'a@u-0-2'),
97
98
['a@u-0-1', 'a@u-0-2', 'b@u-0-3'])
98
99
self.assertEqual(self.intervene('b@u-0-3', 'a@u-0-3'),
99
100
['b@u-0-4', 'a@u-0-3'])
100
self.assertEqual(self.intervene('a@u-0-2', 'a@u-0-3'),
101
self.assertEqual(self.intervene('a@u-0-2', 'a@u-0-3',
102
self.br1.revision_history()),
102
104
self.assertEqual(self.intervene('a@u-0-0', 'a@u-0-5',
103
105
self.br1.revision_history()),
110
112
self.assertEqual(self.intervene('a@u-0-0', 'b@u-0-5'),
111
113
['a@u-0-1', 'a@u-0-2', 'b@u-0-3', 'b@u-0-4',
113
self.assertEqual(self.intervene('b@u-0-3', 'b@u-0-6'),
115
self.assertEqual(self.intervene('b@u-0-3', 'b@u-0-6',
116
self.br2.revision_history()),
114
117
['b@u-0-4', 'b@u-0-5', 'b@u-0-6'])
115
118
self.assertEqual(self.intervene('b@u-0-6', 'b@u-0-10'),
116
['a@u-0-6', 'b@u-0-10'])
117
# self.assertEqual(self.intervene('b@u-0-6', 'b@u-0-10',
118
# self.br2.revision_history()),
119
# ['b@u-0-7', 'b@u-0-8', 'b@u-0-9', 'b@u-0-10'])
119
['b@u-0-7', 'b@u-0-8', 'b@u-0-9', 'b@u-0-10'])
120
self.assertEqual(self.intervene('b@u-0-6', 'b@u-0-10',
121
self.br2.revision_history()),
122
['b@u-0-7', 'b@u-0-8', 'b@u-0-9', 'b@u-0-10'])
123
self.assertRaises(NotAncestor, self.intervene, 'b@u-0-10', 'b@u-0-6',
124
self.br2.revision_history())
125
self.assertRaises(NoSuchRevision, self.intervene, 'c@u-0-10',
126
'b@u-0-6', self.br2.revision_history())
127
self.assertRaises(NoSuchRevision, self.intervene, 'b@u-0-10',
128
'c@u-0-6', self.br2.revision_history())
122
131
class TestCommonAncestor(InTempDir):