Skip to content
Snippets Groups Projects
Commit 907ff34e authored by Denis Laxalde's avatar Denis Laxalde
Browse files

log: add an assertion about fctx not being None in patch.diff()

As noted in the comment, this should not happen as removed files (the cause of
fctx2 being None) are caught earlier.
parent 0ccfc468
No related branches found
No related tags found
No related merge requests found
......@@ -2330,6 +2330,11 @@
losedatafn=losedatafn, prefix=prefix, relroot=relroot, copy=copy,
):
if hunksfilterfn is not None:
# If the file has been removed, fctx2 is None; but this should
# not occur here since we catch removed files early in
# cmdutil.getloglinerangerevs() for 'hg log -L'.
assert fctx2 is not None, \
'fctx2 unexpectly None in diff hunks filtering'
hunks = hunksfilterfn(fctx2, hunks)
text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
if hdr and (text or len(hdr) > 1):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment