Bug 1234912 - Check for |mozext| after |mach artifact install| hg failure. r?gps
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -396,22 +396,30 @@ class PushHeadCache(CacheManager):
def __init__(self, hg, cache_dir, log=None):
# It's not unusual to pull hundreds of changesets at once, and perhaps
# |hg up| back and forth a few times.
CacheManager.__init__(self, cache_dir, 'pushheads', MAX_CACHED_PARENTS, log=log)
self._hg = hg
@cachedmethod(operator.attrgetter('_cache'))
def pushheads(self, tree, parent):
- pushheads = subprocess.check_output([self._hg, 'log',
- '--template', '{node}\n',
- '-r', 'last(pushhead("{tree}") and ::"{parent}", {num})'.format(
- tree=tree, parent=parent, num=NUM_PUSHHEADS_TO_QUERY_PER_PARENT)])
- pushheads = pushheads.strip().split('\n')
- return pushheads
+ try:
+ pushheads = subprocess.check_output([self._hg, 'log',
+ '--template', '{node}\n',
+ '-r', 'last(pushhead("{tree}") and ::"{parent}", {num})'.format(
+ tree=tree, parent=parent, num=NUM_PUSHHEADS_TO_QUERY_PER_PARENT)])
+ pushheads = pushheads.strip().split('\n')
+ return pushheads
+ except subprocess.CalledProcessError as e:
+ # Probably don't have the mozext extension installed.
+ ret = subprocess.call([self._hg, 'showconfig', 'extensions.mozext'])
+ if ret:
+ raise Exception('Could not find candidate pushheads. Enable the "mozext" hg extension.')
+ # Otherwise, perhaps the pushlog database is not present locally.
+ raise Exception('Could not find candidate pushheads. Try running |hg pushlogsync|.')
class TaskCache(CacheManager):
'''Map candidate pushheads to Task Cluster task IDs and artifact URLs.'''
def __init__(self, cache_dir, log=None):
CacheManager.__init__(self, cache_dir, 'artifact_url', MAX_CACHED_TASKS, log=log)
self._index = taskcluster.Index()