##// END OF EJS Templates
patch: make parsepatch optionally trim context lines...
patch: make parsepatch optionally trim context lines Previously there is a suspicious `if False and delta > 0` which dates back to the beginning of hgext/record.py (b2607267236d). The "trimming context lines" feature could be useful (and is used by the next patch). So let's enable it. This patch adds a new `maxcontext` parameter to `recordhunk` and `parsepatch`, changing the `if False` condition to respect it. The old `trimcontext` implementation is also wrong - it does not update `toline` correctly and it does not do the right thing for `before` context. A doctest was added to guard us from making a similar mistake again. Since `maxcontext` is set to `None` (unlimited), there is no behavior change.
Jun Wu -
r33270:f7b63571 default
Show More
Name Size Modified Last Commit Author
/ mercurial / cffi
__init__.py Loading ...
base85.py Loading ...
bdiff.py Loading ...
bdiffbuild.py Loading ...
diffhelpers.py Loading ...
mpatch.py Loading ...
mpatchbuild.py Loading ...
osutil.py Loading ...
osutilbuild.py Loading ...
parsers.py Loading ...