Mercurial > hg-stable
diff tests/test-annotate.t @ 39396:34ba47117164
formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Note that {path} in status is either relative-to-cwd or repository-absolute
depending on the command argument and config knob, which can't be reproduced
by using the {path|relpath} filter. The default template is updated to always
use a relative path.
.. bc::
``{abspath}`` and ``{file}`` in generic templates are renamed to ``{path}``.
Any ``{path}`` is a repository-absolute path. Use ``{path|relpath}`` to
convert it to a filesystem path.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 05 Aug 2018 16:44:16 +0900 |
parents | 5b04a0c30f3f |
children | 5abc47d4ca6b |
line wrap: on
line diff
--- a/tests/test-annotate.t Sun Aug 05 16:27:09 2018 +0900 +++ b/tests/test-annotate.t Sun Aug 05 16:44:16 2018 +0900 @@ -56,7 +56,6 @@ $ hg annotate -Tjson a [ { - "abspath": "a", "lines": [{"line": "a\n", "rev": 0}], "path": "a" } @@ -65,8 +64,7 @@ $ hg annotate -Tjson -cdfnul a [ { - "abspath": "a", - "lines": [{"date": [1.0, 0], "file": "a", "line": "a\n", "line_number": 1, "node": "8435f90966e442695d2ded29fdade2bac5ad8065", "rev": 0, "user": "nobody"}], + "lines": [{"date": [1.0, 0], "line": "a\n", "line_number": 1, "node": "8435f90966e442695d2ded29fdade2bac5ad8065", "path": "a", "rev": 0, "user": "nobody"}], "path": "a" } ] @@ -127,12 +125,10 @@ $ hg annotate -Tjson a b [ { - "abspath": "a", "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}], "path": "a" }, { - "abspath": "b", "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}, {"line": "b4\n", "rev": 3}, {"line": "b5\n", "rev": 3}, {"line": "b6\n", "rev": 3}], "path": "b" } @@ -140,7 +136,7 @@ annotate multiple files (template) - $ hg annotate -T'== {abspath} ==\n{lines % "{rev}: {line}"}' a b + $ hg annotate -T'== {path} ==\n{lines % "{rev}: {line}"}' a b == a == 0: a 1: a @@ -568,7 +564,6 @@ $ hg annotate -ncr "wdir()" -Tjson foo [ { - "abspath": "foo", "lines": [{"line": "foo\n", "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", "rev": 11}, {"line": "foofoo\n", "node": null, "rev": null}], "path": "foo" } @@ -870,11 +865,9 @@ $ hg annotate -Tjson binary empty [ { - "abspath": "binary", "path": "binary" }, { - "abspath": "empty", "lines": [], "path": "empty" }