summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-05-24 21:19:31 -0700
committerNathan Binkert <nate@binkert.org>2011-05-24 21:19:31 -0700
commit1c23bc100f2cdb786f62e6e524de989612b6d819 (patch)
tree8d0500c95a2c0565dad4b29964629af46b9beea0 /util
parent0cbbedcc337e9b05bcc2bf1c91aef3c6bf061ebe (diff)
downloadgem5-1c23bc100f2cdb786f62e6e524de989612b6d819.tar.xz
style: Make the style hook work in directories other than the root.
Diffstat (limited to 'util')
-rw-r--r--util/style.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/util/style.py b/util/style.py
index 30d39aae8..2b9f654d4 100644
--- a/util/style.py
+++ b/util/style.py
@@ -400,10 +400,12 @@ def do_check_style(hgui, repo, *files, **args):
if skip(fname):
continue
- if whitespace.apply(fname, prompt):
+ fpath = joinpath(repo.root, fname)
+
+ if whitespace.apply(fpath, prompt):
return True
- if sorted_includes.apply(fname, prompt):
+ if sorted_includes.apply(fpath, prompt):
return True
try:
@@ -416,12 +418,13 @@ def do_check_style(hgui, repo, *files, **args):
if skip(fname):
continue
+ fpath = joinpath(repo.root, fname)
regions = modregions(wctx, fname)
- if whitespace.apply(fname, prompt, regions):
+ if whitespace.apply(fpath, prompt, regions):
return True
- if sorted_includes.apply(fname, prompt, regions):
+ if sorted_includes.apply(fpath, prompt, regions):
return True
return False
@@ -434,7 +437,7 @@ def do_check_format(hgui, repo, **args):
verbose = 0
stats = ValidationStats()
for f in modified + added:
- validate(f, stats, verbose, None)
+ validate(joinpath(repo.root, f), stats, verbose, None)
if stats:
stats.dump()