diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -733,7 +733,9 @@ size = 0 while tmfnodes: - dir = min(tmfnodes) + # Pick some element from tmfnodes, this is not necessarily the 'min' + # element. + dir = next(iter(tmfnodes)) nodes = tmfnodes[dir] prunednodes = self.prune(dirlog(dir), nodes, commonrevs) if not dir or prunednodes: