~ddaa/trac-bzr/quoting

« back to all changes in this revision

Viewing changes to tracbzr/tests/test_node.py

  • Committer: Jelmer Vernooij
  • Date: 2009-05-06 01:05:14 UTC
  • Revision ID: jelmer@samba.org-20090506010514-9qgpikicukw9trgg
Avoid _get_weave.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# This software may be used and distributed according to the terms
5
5
# of the GNU General Public License, incorporated herein by reference.
6
6
 
 
7
import urllib
 
8
 
7
9
from bzrlib import conflicts
 
10
from bzrlib.revision import (
 
11
    CURRENT_REVISION,
 
12
    )
8
13
from bzrlib.tests import treeshape
9
14
 
10
15
from tracbzr import tests
16
21
        treeshape.build_tree_contents([('repo/tree/a/',), ('repo/tree/a/b', 
17
22
                                        'contents of 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')])
24
29
        other.add(['a/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
40
45
         
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()))
52
56
 
53
57
    def test_get_dir_history(self):
54
58
        self.commit_foo_bar_baz()