summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-02-26 12:01:00 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-02-26 12:01:00 +0000
commit7b295f379bd16f75cb64d43a5100e19d5cd330f2 (patch)
tree85049a9ddaef76f26217a322d917e30219547a46 /lib/redmine/scm
parente266ddb309652defea3d852e9d22212f124e6440 (diff)
downloadredmine-7b295f379bd16f75cb64d43a5100e19d5cd330f2.tar.gz
redmine-7b295f379bd16f75cb64d43a5100e19d5cd330f2.zip
Mercurial 2.9 compatibility (#16177)
git-svn-id: http://svn.redmine.org/redmine/trunk@12930 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/scm')
-rw-r--r--lib/redmine/scm/adapters/mercurial/redminehelper.py9
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 a3a8d802f..6056dd803 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)