Files @ a8b407f29405
Branch filter:

Location: kallithea/tox.ini

Manuel Jacob
controllers: don’t pass start=0 to BaseRepository.get_changesets()

MercurialRepository.get_changesets() can fail if passing start=0 if the
revision 0 is not in self.revisions. That can happen if revision 0 is not in
the visible subset of the revisions in the repository. Before Kallithea
changeset 7c43e15fb8bc7a73f17f577e59a4698589b6809d, it was working by chance
because start=0 was treated like start=None in the relevant places
(GitRepository.get_changesets still does that).

The intention of passing start=0 was seemingly to not limit the start.
Therefore passing start=None (or nothing, as it’s the default value) should be
correct.

I got the following traceback before this change:

Traceback (most recent call last):
File "~/vcs/kallithea/kallithea/controllers/changelog.py", line 117, in index
collection = c.db_repo_scm_instance.get_changesets(start=0, end=revision,
File "~/vcs/kallithea/kallithea/lib/vcs/backends/hg/repository.py", line 529, in get_changesets
start_pos = None if start is None else self.revisions.index(start_raw_id)
ValueError: '4257f758b3eaacaebb6956d1aefc019afab956b8' is not in list
[tox]
minversion = 1.8
envlist = py27-pytest

[testenv]
setenv =
    PYTHONHASHSEED = 0
deps =
    -r{toxinidir}/dev_requirements.txt
    python-ldap
    python-pam
commands =
    pytest: py.test {posargs}