tests/test-gendoc-zh_CN.t
author Jun Wu <quark@fb.com>
Tue, 04 Jul 2017 16:41:28 -0700
changeset 33270 f7b635716ef2
parent 28809 7a1ad08b9ff5
permissions -rw-r--r--
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.

#require docutils gettext

  $ $TESTDIR/check-gendoc zh_CN
  checking for parse errors