Fix backward incompatible change for hg < 5.1

The port to Python 3 in b961f146 changed `repo.branchmap().iteritems()`
to use `.items()` instead. However, the object returned by mercurial
isn't a dictionary and its `.items()` method was only introduced (as an
alias for `iteritems`) in hg 5.1. `iteritems()` still exists, so let's
keep using it for now to retain compatibility with hg < 5.1.
This commit is contained in:
chrisjbillington
2020-05-06 11:59:35 -04:00
parent f102d2a69f
commit d29d30363b

View File

@@ -477,7 +477,7 @@ def branchtip(repo, heads):
def verify_heads(ui,repo,cache,force,branchesmap):
branches={}
for bn, heads in repo.branchmap().items():
for bn, heads in repo.branchmap().iteritems():
branches[bn] = branchtip(repo, heads)
l=[(-repo.changelog.rev(n), n, t) for t, n in branches.items()]
l.sort()