Mercurial > hgsubversion
comparison tests/comprehensive/test_verify_and_startrev.py @ 1048:903c9c9dfe6a
tests: count revisions explicitly
The assumption that len(repo) corresponds to the count of actual,
usable revision in the repository fails in presence of hidden
revisions. Instead, we use a dedicated method in test_util, and change
all tests to use this for obtaining repository length -- just to be
safe...
| author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
|---|---|
| date | Fri, 09 Aug 2013 11:22:50 -0400 |
| parents | 36fe4b316a6b |
| children | cd256960b622 |
comparison
equal
deleted
inserted
replaced
| 1047:3092b3c109a8 | 1048:903c9c9dfe6a |
|---|---|
| 39 | 39 |
| 40 def _do_case(self, name, stupid, layout): | 40 def _do_case(self, name, stupid, layout): |
| 41 subdir = test_util.subdir.get(name, '') | 41 subdir = test_util.subdir.get(name, '') |
| 42 repo, svnpath = self.load_and_fetch(name, subdir=subdir, stupid=stupid, | 42 repo, svnpath = self.load_and_fetch(name, subdir=subdir, stupid=stupid, |
| 43 layout=layout) | 43 layout=layout) |
| 44 assert len(self.repo) > 0 | 44 assert test_util.repolen(self.repo) > 0 |
| 45 for i in repo: | 45 for i in repo: |
| 46 ctx = repo[i] | 46 ctx = repo[i] |
| 47 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(), | 47 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(), |
| 48 stupid=True), 0) | 48 stupid=True), 0) |
| 49 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(), | 49 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(), |
| 53 if layout == 'single' and name not in _skipshallow: | 53 if layout == 'single' and name not in _skipshallow: |
| 54 self.wc_path += '_shallow' | 54 self.wc_path += '_shallow' |
| 55 shallowrepo = self.fetch(svnpath, subdir=subdir, stupid=stupid, | 55 shallowrepo = self.fetch(svnpath, subdir=subdir, stupid=stupid, |
| 56 layout='single', startrev='HEAD') | 56 layout='single', startrev='HEAD') |
| 57 | 57 |
| 58 self.assertEqual(len(shallowrepo), 1, | 58 self.assertEqual(test_util.repolen(shallowrepo), 1, |
| 59 "shallow clone should have just one revision, not %d" | 59 "shallow clone should have just one revision, not %d" |
| 60 % len(shallowrepo)) | 60 % test_util.repolen(shallowrepo)) |
| 61 | 61 |
| 62 fulltip = repo['tip'] | 62 fulltip = repo['tip'] |
| 63 shallowtip = shallowrepo['tip'] | 63 shallowtip = shallowrepo['tip'] |
| 64 | 64 |
| 65 repo.ui.pushbuffer() | 65 repo.ui.pushbuffer() |
