]> source.dussan.org Git - redmine.git/commitdiff
Merged r12930 from trunk to 2.4-stable (#16177)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 26 Feb 2014 13:06:02 +0000 (13:06 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 26 Feb 2014 13:06:02 +0000 (13:06 +0000)
Mercurial 2.9 compatibility.

git-svn-id: http://svn.redmine.org/redmine/branches/2.4-stable@12934 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/mercurial/redminehelper.py

index bd82c00200c0d9f6faef6cd13ef1d19cfd264828..1e1bc8db1bd39cf366e97986e44f24327d4451f8 100644 (file)
@@ -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)