diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-26 13:06:02 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-26 13:06:02 +0000 |
commit | dac4f38eb478187c33ebddcb024e7c896368fb5c (patch) | |
tree | cb085fefdc89c140aa2ad42e7bcd732e13897b3e | |
parent | 5e031bce4703355222397c8df5ffe683c2d6a237 (diff) | |
download | redmine-dac4f38eb478187c33ebddcb024e7c896368fb5c.tar.gz redmine-dac4f38eb478187c33ebddcb024e7c896368fb5c.zip |
Merged r12930 from trunk to 2.4-stable (#16177)
Mercurial 2.9 compatibility.
git-svn-id: http://svn.redmine.org/redmine/branches/2.4-stable@12934 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/redmine/scm/adapters/mercurial/redminehelper.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/redmine/scm/adapters/mercurial/redminehelper.py b/lib/redmine/scm/adapters/mercurial/redminehelper.py index bd82c0020..1e1bc8db1 100644 --- a/lib/redmine/scm/adapters/mercurial/redminehelper.py +++ b/lib/redmine/scm/adapters/mercurial/redminehelper.py @@ -79,8 +79,13 @@ def _tags(ui, repo): def _branches(ui, repo): # see mercurial/commands.py:branches def iterbranches(): - for t, n in repo.branchtags().iteritems(): - yield t, n, repo.changelog.rev(n) + if hasattr(repo, 'branchtags'): + # Mercurial < 2.9 + for t, n in repo.branchtags().iteritems(): + yield t, n, repo.changelog.rev(n) + else: + for tag, heads, tip, isclosed in repo.branchmap().iterbranches(): + yield tag, tip, repo.changelog.rev(tip) def branchheads(branch): try: return repo.branchheads(branch, closed=False) |