diff --git a/lib/redmine/scm/adapters/mercurial/redminehelper.py b/lib/redmine/scm/adapters/mercurial/redminehelper.py index 6056dd803..b7d98a18f 100644 --- a/lib/redmine/scm/adapters/mercurial/redminehelper.py +++ b/lib/redmine/scm/adapters/mercurial/redminehelper.py @@ -79,7 +79,7 @@ def _tags(ui, repo): def _branches(ui, repo): # see mercurial/commands.py:branches def iterbranches(): - if hasattr(repo, 'branchtags'): + if getattr(repo, 'branchtags', None) is not None: # Mercurial < 2.9 for t, n in repo.branchtags().iteritems(): yield t, n, repo.changelog.rev(n)