Bug 1390239 - Accommodate any ordering of "last" revset in artifact builds.
A recent mercurial update changed the order of revisions returned by the
"last" revset. The expected revisions are still output, so the artifact
code is updated in this change to impose its own order based on the local
revision order to accommodate any output order.
MozReview-Commit-ID: 7Zka0kQtxJO
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -971,22 +971,25 @@ class Artifacts(object):
"""Returns recent ancestors of the working parent that are likely to
to be known to Mozilla automation.
If we're using git, retrieves hg revisions from git-cinnabar.
"""
if self._git:
return self._get_hg_revisions_from_git()
- return subprocess.check_output([
+ # Mercurial updated the ordering of "last" in 4.3. We use revision
+ # numbers to order here to accommodate multiple versions of hg.
+ last_revs = subprocess.check_output([
self._hg, 'log',
- '--template', '{node}\n',
+ '--template', '{rev}:{node}\n',
'-r', 'last(public() and ::., {num})'.format(
num=NUM_REVISIONS_TO_QUERY)
], cwd=self._topsrcdir).splitlines()
+ return [i.split(':')[-1] for i in sorted(last_revs, reverse=True)]
def _find_pushheads(self):
"""Returns an iterator of recent pushhead revisions, starting with the
working parent.
"""
last_revs = self._get_recent_public_revisions()
candidate_pushheads = self._pushheads_from_rev(last_revs[0].rstrip(),