16
21
treeshape.build_tree_contents([('repo/tree/a/',), ('repo/tree/a/b',
18
23
self.tree.add(['a', 'a/b'])
19
self.tree.commit('tree contents', rev_id='foo%bar')
24
self.tree.commit('tree contents', rev_id='foo%bar') #tree,1
20
25
other = self.tree.bzrdir.sprout('repo/other').open_workingtree()
21
26
treeshape.build_tree_contents([
22
27
('repo/other/a/b', 'new contents of b'),
23
28
('repo/other/a/c', 'contents of c')])
25
other.commit('added c, changed b', rev_id='baz')
30
other.commit('added c, changed b', rev_id='baz') #other,1
26
31
self.tree.merge_from_branch(other.branch)
27
self.tree.commit('merged from other', rev_id='qux')
28
self.tree.commit('empty commit', rev_id='quxx')
32
self.tree.commit('merged from other', rev_id='qux') #tree,2
33
self.tree.commit('empty commit', rev_id='quxx') #tree,3
29
34
treeshape.build_tree_contents([
30
35
('repo/tree/a/b', 'b_tree')])
31
self.tree.commit('changed b', rev_id='quxxx')
36
self.tree.commit('changed b', rev_id='quxxx') #tree,4
32
37
treeshape.build_tree_contents([
33
38
('repo/other/a/b', 'new again')])
34
other.commit('changed b')
39
other.commit('changed b') #other,2
35
40
self.tree.merge_from_branch(other.branch)
36
41
treeshape.build_tree_contents([
37
42
('repo/tree/a/b', 'b_tree')])
38
43
self.tree.set_conflicts(conflicts.ConflictList([]))
39
return self.tree.commit('resolved in favour of tree', rev_id='quxxxx')
44
return self.tree.commit('resolved in favour of tree', rev_id='quxxxx') #tree,5
41
46
def test_get_history(self):
42
47
self.commit_foo_bar_baz()
43
48
repo = self.trac_repo()
44
49
node = repo.get_node('tree/a/b')
45
self.assertEqual([(u'tree/a/b', 'tree,5', 'edit'),
46
(u'tree/a/b', 'tree,4', 'edit'),
50
self.assertEqual([(u'tree/a/b', 'tree,4', 'edit'),
47
51
(u'tree/a/b', 'tree,2', 'edit'),
48
52
(u'tree/a/b', 'tree,1', 'add')],
49
53
list(node.get_history()))
50
54
node = repo.get_node('')
51
self.assertEqual([('', 'current%3A', 'add')], list(node.get_history()))
55
self.assertEqual([('', urllib.quote(CURRENT_REVISION), 'add')], list(node.get_history()))
53
57
def test_get_dir_history(self):
54
58
self.commit_foo_bar_baz()