/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_branch.py

Stop importing tags as branches as part of git-import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        self.assertEqual([default_mapping.revision_id_foreign_to_bzr(r) for r in (reva, revb)],
84
84
                         thebranch.revision_history())
85
85
 
86
 
    def test_tags(self):
 
86
    def test_tag_annotated(self):
87
87
        self.simple_commit_a()
88
88
        reva = tests.run_git('rev-parse', 'HEAD').strip()
89
 
        
90
89
        tests.run_git('tag', '-a', '-m', 'add tag', 'foo')
91
 
        
92
 
        thebranch = Branch.open('.')
93
 
        self.assertEquals({"foo": default_mapping.revision_id_foreign_to_bzr(reva)},
94
 
                          thebranch.tags.get_tag_dict())
 
90
        thebranch = Branch.open('.')
 
91
        self.assertEquals({"foo": default_mapping.revision_id_foreign_to_bzr(reva)},
 
92
                          thebranch.tags.get_tag_dict())
 
93
 
 
94
    def test_tag(self):
 
95
        self.simple_commit_a()
 
96
        reva = tests.run_git('rev-parse', 'HEAD').strip()
 
97
        tests.run_git('tag', '-m', 'add tag', 'foo')
 
98
        thebranch = Branch.open('.')
 
99
        self.assertEquals({"foo": default_mapping.revision_id_foreign_to_bzr(reva)},
 
100
                          thebranch.tags.get_tag_dict())
 
101
 
95
102
        
96
103
 
97
104
class TestWithGitBranch(tests.TestCaseWithTransport):
122
129
 
123
130
 
124
131
 
125
 
class BranchFetchTests(tests.TestCaseInTempDir):
 
132
class BranchTests(tests.TestCaseInTempDir):
126
133
 
127
134
    def make_onerev_branch(self):
128
135
        os.mkdir("d")
146
153
        revid = oldrepo.get_mapping().revision_id_foreign_to_bzr(gitsha)
147
154
        newbranch = self.clone_git_branch(path, "f")
148
155
        self.assertEquals([revid], newbranch.repository.all_revision_ids())
 
156
 
 
157
    def test_sprouted_tags(self):
 
158
        path, gitsha = self.make_onerev_branch()
 
159
        os.chdir(path)
 
160
        tests.run_git("tag", "lala")
 
161
        os.chdir(self.test_dir)
 
162
        oldrepo = Repository.open(path)
 
163
        revid = oldrepo.get_mapping().revision_id_foreign_to_bzr(gitsha)
 
164
        newbranch = self.clone_git_branch(path, "f")
 
165
        self.assertEquals({"lala": revid}, newbranch.tags.get_tag_dict())
 
166
        self.assertEquals([revid], newbranch.repository.all_revision_ids())