diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2007-07-22 08:10:59 -0700 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2007-07-22 08:10:59 -0700 |
commit | d5c74657c986a1c6730393d76da6d8859ae7fca4 (patch) | |
tree | 9de36c35735432220f010b98a25b0f380d13ef6a /SConstruct | |
parent | 1c2d5f5e64387527efe495a59f6946e7b539a543 (diff) | |
parent | 03730edc45e2e00bdec58dabc84e94c632634a1a (diff) | |
download | gem5-d5c74657c986a1c6730393d76da6d8859ae7fca4.tar.xz |
Merge more changes in from head.
--HG--
extra : convert_revision : 8f170f2754eccdb424a35b5b077225abcf6eee72
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct index ffcd84706..ec60964e4 100644 --- a/SConstruct +++ b/SConstruct @@ -67,7 +67,7 @@ import sys import os import subprocess -from os.path import join as joinpath +from os.path import isdir, join as joinpath # Check for recent-enough Python and SCons versions. If your system's # default installation of Python is not recent enough, you can use a @@ -97,6 +97,34 @@ SRCDIR = joinpath(ROOT, 'src') # tell python where to find m5 python code sys.path.append(joinpath(ROOT, 'src/python')) +def check_style_hook(ui): + ui.readconfig(joinpath(ROOT, '.hg', 'hgrc')) + style_hook = ui.config('hooks', 'pretxncommit.style', None) + + if not style_hook: + print """\ +You're missing the M5 style hook. +Please install the hook so we can ensure that all code fits a common style. + +All you'd need to do is add the following lines to your repository .hg/hgrc +or your personal .hgrc +---------------- + +[extensions] +style = %s/util/style.py + +[hooks] +pretxncommit.style = python:style.check_whitespace +""" % (ROOT) + sys.exit(1) + +if isdir(joinpath(ROOT, '.hg')): + try: + from mercurial import ui + check_style_hook(ui.ui()) + except ImportError: + pass + ################################################### # # Figure out which configurations to set up based on the path(s) of |