Bug 1283439 - Include OpusDecoder.h only for Rust MP4 parsing r=kinetik
[gecko.git] / config / check_utils.py
blob035402beb11f1392af237008f46efcd50cbb71ec
1 # vim: set ts=8 sts=4 et sw=4 tw=99:
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 import subprocess
8 def get_all_toplevel_filenames():
9 '''Get a list of all the files in the (Mercurial or Git) repository.'''
10 failed_cmds = []
11 try:
12 cmd = ['hg', 'manifest', '-q']
13 all_filenames = subprocess.check_output(cmd, universal_newlines=True,
14 stderr=subprocess.PIPE).split('\n')
15 return all_filenames
16 except:
17 failed_cmds.append(cmd)
19 try:
20 # Get the relative path to the top-level directory.
21 cmd = ['git', 'rev-parse', '--show-cdup']
22 top_level = subprocess.check_output(cmd, universal_newlines=True,
23 stderr=subprocess.PIPE).split('\n')[0]
24 cmd = ['git', 'ls-files', '--full-name', top_level]
25 all_filenames = subprocess.check_output(cmd, universal_newlines=True,
26 stderr=subprocess.PIPE).split('\n')
27 return all_filenames
28 except:
29 failed_cmds.append(cmd)
31 raise Exception('failed to run any of the repo manifest commands', failed_cmds)