llvm.org GIT mirror llvm / 30395dd
[git-llvm] Check if svn is installed. The error message that git-llvm script prints out when svn is missing is very cryptic. I spent a fair amount of time to find what was wrong with my environment. It looks like many newcomers also exprienced a hard time to submit their first patches due to this error. This patch adds a more user-friendly error message. Differential Revision: https://reviews.llvm.org/D33458 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303696 91177308-0d34-0410-b5e6-96231b3b80d8 Rui Ueyama 2 years ago
1 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
132132 return shell(['svn'] + list(cmd), cwd=cwd, stdin=kwargs.get('stdin', None),
133133 ignore_errors=kwargs.get('ignore_errors', None))
134134
135 def program_exists(cmd):
136 for path in os.environ["PATH"].split(os.pathsep):
137 if os.access(os.path.join(path, cmd), os.X_OK):
138 return True
139 return False
135140
136141 def get_default_rev_range():
137142 # Get the branch tracked by the current branch, as set by
308313
309314
310315 if __name__ == '__main__':
316 if not program_exists('svn'):
317 die('error: git-llvm needs svn command, but svn is not installed.')
318
311319 argv = sys.argv[1:]
312320 p = argparse.ArgumentParser(
313321 prog='git llvm', formatter_class=argparse.RawDescriptionHelpFormatter,