/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tests/test_git_branch.py

SupportĀ listingĀ tags.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        self.assertEqual((0, revision.NULL_REVISION),
46
46
                         thebranch.last_revision_info())
47
47
 
 
48
    def simple_commit_a(self):
 
49
        tests.run_git('init')
 
50
        self.build_tree(['a'])
 
51
        tests.run_git('add', 'a')
 
52
        tests.run_git('commit', '-m', 'a')
 
53
 
48
54
    def test_last_revision_is_valid(self):
49
 
        tests.run_git('init')
50
 
        self.build_tree(['a'])
51
 
        tests.run_git('add', 'a')
52
 
        tests.run_git('commit', '-m', 'a')
 
55
        self.simple_commit_a()
53
56
        head = tests.run_git('rev-parse', 'HEAD').strip()
54
57
 
55
58
        thebranch = branch.Branch.open('.')
57
60
                         thebranch.last_revision())
58
61
 
59
62
    def test_revision_history(self):
60
 
        tests.run_git('init')
61
 
        self.build_tree(['a'])
62
 
        tests.run_git('add', 'a')
63
 
        tests.run_git('commit', '-m', 'a')
 
63
        self.simple_commit_a()
64
64
        reva = tests.run_git('rev-parse', 'HEAD').strip()
65
65
        self.build_tree(['b'])
66
66
        tests.run_git('add', 'b')
70
70
        thebranch = branch.Branch.open('.')
71
71
        self.assertEqual([ids.convert_revision_id_git_to_bzr(r) for r in (reva, revb)],
72
72
                         thebranch.revision_history())
 
73
 
 
74
    def test_tags(self):
 
75
        self.simple_commit_a()
 
76
        reva = tests.run_git('rev-parse', 'HEAD').strip()
 
77
        
 
78
        tests.run_git('tag', '-a', '-m', 'add tag', 'foo')
 
79
        
 
80
        newid = open('.git/refs/tags/foo').read().rstrip()
 
81
 
 
82
        thebranch = branch.Branch.open('.')
 
83
        self.assertEquals({"foo": ids.convert_revision_id_git_to_bzr(newid)},
 
84
                          thebranch.tags.get_tag_dict())
73
85
        
74
86
 
75
87
class TestWithGitBranch(tests.TestCaseWithTransport):