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

  • Committer: Jelmer Vernooij
  • Date: 2010-05-13 09:40:48 UTC
  • mto: (0.200.912 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20100513094048-ntsaywuymtmcufai
Fix Repository.all_revision_ids.

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
 
163
163
class TestGitRepository(tests.TestCaseWithTransport):
164
164
 
 
165
    _test_needs_features = [tests.GitCommandFeature]
 
166
 
 
167
    def _do_commit(self):
 
168
        builder = tests.GitBranchBuilder()
 
169
        builder.set_file('a', 'text for a\n', False)
 
170
        commit_handle = builder.commit('Joe Foo <joe@foo.com>', u'message')
 
171
        mapping = builder.finish()
 
172
        return mapping[commit_handle]
 
173
 
165
174
    def setUp(self):
166
175
        tests.TestCaseWithTransport.setUp(self)
167
176
        dulwich.repo.Repo.create(self.test_dir)
180
189
    def test_all_revision_ids_none(self):
181
190
        self.assertEquals(set([]), self.git_repo.all_revision_ids())
182
191
 
 
192
    def test_all_revision_ids(self):
 
193
        commit_id = self._do_commit()
 
194
        self.assertEquals(set(["git-v1:%s" % commit_id]),
 
195
                self.git_repo.all_revision_ids())
 
196
 
183
197
    def test_get_ancestry_null(self):
184
198
        self.assertEquals([None, revision.NULL_REVISION], self.git_repo.get_ancestry(revision.NULL_REVISION))
185
199