Remove the pointless, repository destroying assertion and just have the script check every line in the file if it cannot get context information.
This commit is contained in:
parent
640b415688
commit
ba8936120e
1 changed files with 7 additions and 5 deletions
|
@ -314,14 +314,16 @@ def do_check_whitespace(ui, repo, *files, **args):
|
||||||
|
|
||||||
fctx = wctx.filectx(fname)
|
fctx = wctx.filectx(fname)
|
||||||
pctx = fctx.parents()
|
pctx = fctx.parents()
|
||||||
assert len(pctx) in (1, 2)
|
|
||||||
|
|
||||||
file_data = fctx.data()
|
file_data = fctx.data()
|
||||||
lines = mdiff.splitnewlines(file_data)
|
lines = mdiff.splitnewlines(file_data)
|
||||||
|
if len(pctx) in (1, 2):
|
||||||
mod_lines = modified_lines(pctx[0].data(), file_data, len(lines))
|
mod_lines = modified_lines(pctx[0].data(), file_data, len(lines))
|
||||||
if len(pctx) == 2:
|
if len(pctx) == 2:
|
||||||
m2 = modified_lines(pctx[1].data(), file_data, len(lines))
|
m2 = modified_lines(pctx[1].data(), file_data, len(lines))
|
||||||
mod_lines = mod_lines & m2 # only the lines that are new in both
|
mod_lines = mod_lines & m2 # only the lines that are new in both
|
||||||
|
else:
|
||||||
|
mod_lines = xrange(0, len(lines))
|
||||||
|
|
||||||
fixonly = set()
|
fixonly = set()
|
||||||
for i,line in enumerate(lines):
|
for i,line in enumerate(lines):
|
||||||
|
|
Loading…
Reference in a new issue