tests: add test for hg-test-mode emacs code
This is just coverage for the compilation-mode support, but that was
enough of a hassle that I wanted to have it covered somehow. Test
methodology is _extremely_ cargo-culted from the test for
compilation-mode in emacs, so I still have no idea what I'm doing.
Differential Revision: https://phab.mercurial-scm.org/D6003
hghave: add check for GNU emacs
Differential Revision: https://phab.mercurial-scm.org/D6002
contrib: also linkify tracebacks in compilation output when using hg-test-mode
Differential Revision: https://phab.mercurial-scm.org/D6001
contrib: add compilation-mode linking for our test output
These regular expressions will cause compilation-mode buffers in emacs
to link to source when there are check-code errors in the output of a
.t test.
In the true tradition of this file, I also have no idea what I'm doing.
Differential Revision: https://phab.mercurial-scm.org/D6000
diff: make sure we output stat even when --git is not passed (
issue4037) (BC)
Before this patch, `hg diff --stat` will give an empty output. It will not show
the stat information. I debugged and found that the underlying code does not
return the diff header and due to that, other code paths fails to parse that as
a diff.
I looked into why we don't return diff headers in quiet mode and found the
behavior is from
8f8bb77d560e70bcc95577e4dfa877df18d876ab which does not have
any mention about why it is done. We also show the diff headers in git, so I
think it's fine showing diff header in normal diff in quiet mode.
Differential Revision: https://phab.mercurial-scm.org/D6007
tests: add test to demonstrate
issue4037
`hg diff --stat -q --config diff.git=0` does not output anything whereas it
should print the stat. This is a quiet old bug dating to 2013 and looking at
code I think it exists it since 2005 or when --stat was introduced. The next
patch will fix the bug.
Differential Revision: https://phab.mercurial-scm.org/D6006
grep: reuse getrenamedfn() from scmutil
My motivation is to reduce uses of filectx.renamed(). Reusing
scmutil.getrenamedfn() also means that we get some caching of copy
information per file and revision. I don't think that matters for `hg
grep` (I doubt it speeds up significantly, and I doubt it wastes
significant memory), but I'm not sure.
Differential Revision: https://phab.mercurial-scm.org/D6022
templatekw: move getrenamedfn() to scmutil (API)
The function is already used by `hg log` (for following renames, not
for templates), so it seems it does not belong in templatekw.
Differential Revision: https://phab.mercurial-scm.org/D6021
mq: get copy source from context object instead of from filelog
This removes dependence on filelog.renamed().
Differential Revision: https://phab.mercurial-scm.org/D6020
mq: slightly modernize by using context object
Context objects have existed since mid-2006.
Differential Revision: https://phab.mercurial-scm.org/D6019