Deleted Added
sdiff udiff text old ( 11469:015cad6e65d5 ) new ( 11476:8c67ac296e75 )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015, 2016 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 246 unchanged lines hidden (view full) ---

255# Mercurial Stuff.
256#
257# If the gem5 directory is a mercurial repository, we should do some
258# extra things.
259#
260########################################################################
261
262hgdir = main.root.Dir(".hg")
263gitdir = main.root.Dir(".git")
264
265
266style_message = """
267You're missing the gem5 style hook, which automatically checks your code
268against the gem5 style rules on %s.
269This script will now install the hook in your %s.
270Press enter to continue, or ctrl-c to abort: """
271

--- 91 unchanged lines hidden (view full) ---

363 print "Adding style hook to", hgrc_path, "\n"
364 try:
365 with open(hgrc_path, 'a') as f:
366 f.write(mercurial_style_hook)
367 except:
368 print "Error updating", hgrc_path
369 sys.exit(1)
370
371# Try to wire up git to the style hooks
372git_pre_commit_hook = gitdir.File("hooks/pre-commit")
373if not ignore_style and gitdir.exists() and not git_pre_commit_hook.exists():
374 git_style_script = File("util/git-pre-commit.py")
375
376 print git_style_message,
377 try:
378 raw_input()
379 except:
380 print "Input exception, exiting scons.\n"
381 sys.exit(1)
382
383 try:
384 rel_style_script = os.path.relpath(
385 git_style_script.get_abspath(),
386 git_pre_commit_hook.Dir(".").get_abspath())
387 os.symlink(rel_style_script, git_pre_commit_hook.get_abspath())
388 except:
389 print "Error updating git pre-commit hook"
390 raise
391 sys.exit(1)
392
393###################################################
394#
395# Figure out which configurations to set up based on the path(s) of
396# the target(s).
397#
398###################################################
399
400# Find default configuration & binary.

--- 1130 unchanged lines hidden ---