summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorClint Smullen <cws3k@cs.virginia.edu>2008-11-15 00:21:31 -0500
committerClint Smullen <cws3k@cs.virginia.edu>2008-11-15 00:21:31 -0500
commitba8936120e4de7a4cdf6093a0e0cb04e0d1b8a59 (patch)
treed8765ba5a1d9bc3cc91968007712fba7e4c3b0b3 /util
parent640b415688f8942ee61ac26f8bbc538596df00a4 (diff)
downloadgem5-ba8936120e4de7a4cdf6093a0e0cb04e0d1b8a59.tar.xz
Remove the pointless, repository destroying assertion and just have the script check every line in the file if it cannot get context information.
Diffstat (limited to 'util')
-rw-r--r--util/style.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/util/style.py b/util/style.py
index 8b0f48fb9..a117fab70 100644
--- a/util/style.py
+++ b/util/style.py
@@ -314,14 +314,16 @@ def do_check_whitespace(ui, repo, *files, **args):
fctx = wctx.filectx(fname)
pctx = fctx.parents()
- assert len(pctx) in (1, 2)
file_data = fctx.data()
lines = mdiff.splitnewlines(file_data)
- mod_lines = modified_lines(pctx[0].data(), file_data, len(lines))
- if len(pctx) == 2:
- m2 = modified_lines(pctx[1].data(), file_data, len(lines))
- mod_lines = mod_lines & m2 # only the lines that are new in both
+ if len(pctx) in (1, 2):
+ mod_lines = modified_lines(pctx[0].data(), file_data, len(lines))
+ if len(pctx) == 2:
+ m2 = modified_lines(pctx[1].data(), file_data, len(lines))
+ mod_lines = mod_lines & m2 # only the lines that are new in both
+ else:
+ mod_lines = xrange(0, len(lines))
fixonly = set()
for i,line in enumerate(lines):