##// END OF EJS Templates
identify: add template support...
identify: add template support This is based on a patch proposed last year by Mathias De Maré[1], with a few changes. - Tags and bookmarks are now formatted lists, for more flexible queries. - The templater is populated whether or not [-nibtB] is specified. (Plain output is unchanged.) This seems more consistent with other templated commands. - The 'id' property is a string, instead of a list. - The parents of 'wdir()' have their own list of attributes. I left 'id' as a string because it seems very useful for generating version info. It's also a bit strange because the value and meaning changes depending on whether or not --debug is passed (short vs full hash), whether the revision is a merge or not (one hash or two, separated by a '+'), the working directory or not (node vs p1node), and local or not (remote defaults to tip, and never has '+'). The equivalent string built with {rev} seems much less useful, and I couldn't think of a reasonable name, so I left it out. The discussion seemed to be pointing towards having a list of nodes, with more than one entry for a merge. It seems simpler to give the nodes a name, and use {node} for the actual commit probed, especially now that there is a virtual node for 'wdir()'. Yuya mentioned using fm.nested() in that thread, so I did for the parent nodes. I'm not sure if the plan is to fill in all of the context attributes in these items, or if these nested items should simply be made {p1node} and {p1rev}. I used ':' as the tag separator for consistency with {tags} in the log templater. Likewise, bookmarks are separated by a space for consistency with the corresponding log template. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-August/087039.html

File last commit:

r29893:4c28ddda default
r33051:15a79ac8 default
Show More
test-debugextensions.t
113 lines | 2.2 KiB | text/troff | Tads3Lexer
/ tests / test-debugextensions.t
liscju
mercurial: add debugextensions command (issue4676)...
r26351 $ hg debugextensions
$ debugpath=`pwd`/extwithoutinfos.py
$ cat > extwithoutinfos.py <<EOF
> EOF
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 $ cat > extwithinfos.py <<EOF
> testedwith = '3.0 3.1 3.2.1'
> buglink = 'https://example.org/bts'
> EOF
liscju
mercurial: add debugextensions command (issue4676)...
r26351
$ cat >> $HGRCPATH <<EOF
> [extensions]
> color=
> histedit=
> patchbomb=
> rebase=
> mq=
> ext1 = $debugpath
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 > ext2 = `pwd`/extwithinfos.py
liscju
mercurial: add debugextensions command (issue4676)...
r26351 > EOF
$ hg debugextensions
color
ext1 (untested!)
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 ext2 (3.2.1!)
liscju
mercurial: add debugextensions command (issue4676)...
r26351 histedit
mq
patchbomb
rebase
$ hg debugextensions -v
color
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 location: */hgext/color.py* (glob)
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 bundled: yes
liscju
mercurial: add debugextensions command (issue4676)...
r26351 ext1
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 location: */extwithoutinfos.py* (glob)
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 bundled: no
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 ext2
location: */extwithinfos.py* (glob)
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 bundled: no
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 tested with: 3.0 3.1 3.2.1
bug reporting: https://example.org/bts
liscju
mercurial: add debugextensions command (issue4676)...
r26351 histedit
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 location: */hgext/histedit.py* (glob)
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 bundled: yes
liscju
mercurial: add debugextensions command (issue4676)...
r26351 mq
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 location: */hgext/mq.py* (glob)
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 bundled: yes
liscju
mercurial: add debugextensions command (issue4676)...
r26351 patchbomb
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 location: */hgext/patchbomb.py* (glob)
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 bundled: yes
liscju
mercurial: add debugextensions command (issue4676)...
r26351 rebase
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 location: */hgext/rebase.py* (glob)
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 bundled: yes
liscju
mercurial: add debugextensions command (issue4676)...
r26351
Matt Harbison
test-debugextensions: sanitize JSON output for Windows...
r26430 $ hg debugextensions -Tjson | sed 's|\\\\|/|g'
liscju
mercurial: add debugextensions command (issue4676)...
r26351 [
{
"buglink": "",
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 "bundled": true,
liscju
mercurial: add debugextensions command (issue4676)...
r26351 "name": "color",
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 "source": "*/hgext/color.py*", (glob)
Yuya Nishihara
debugextensions: hide "ships-with-hg-core" magic string (BC)...
r29893 "testedwith": []
liscju
mercurial: add debugextensions command (issue4676)...
r26351 },
{
"buglink": "",
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 "bundled": false,
liscju
mercurial: add debugextensions command (issue4676)...
r26351 "name": "ext1",
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 "source": "*/extwithoutinfos.py*", (glob)
Yuya Nishihara
debugextension: change "testedwith" to a list (BC)...
r29703 "testedwith": []
liscju
mercurial: add debugextensions command (issue4676)...
r26351 },
{
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 "buglink": "https://example.org/bts",
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 "bundled": false,
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 "name": "ext2",
"source": "*/extwithinfos.py*", (glob)
"testedwith": ["3.0", "3.1", "3.2.1"]
},
{
liscju
mercurial: add debugextensions command (issue4676)...
r26351 "buglink": "",
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 "bundled": true,
liscju
mercurial: add debugextensions command (issue4676)...
r26351 "name": "histedit",
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 "source": "*/hgext/histedit.py*", (glob)
Yuya Nishihara
debugextensions: hide "ships-with-hg-core" magic string (BC)...
r29893 "testedwith": []
liscju
mercurial: add debugextensions command (issue4676)...
r26351 },
{
"buglink": "",
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 "bundled": true,
liscju
mercurial: add debugextensions command (issue4676)...
r26351 "name": "mq",
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 "source": "*/hgext/mq.py*", (glob)
Yuya Nishihara
debugextensions: hide "ships-with-hg-core" magic string (BC)...
r29893 "testedwith": []
liscju
mercurial: add debugextensions command (issue4676)...
r26351 },
{
"buglink": "",
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 "bundled": true,
liscju
mercurial: add debugextensions command (issue4676)...
r26351 "name": "patchbomb",
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 "source": "*/hgext/patchbomb.py*", (glob)
Yuya Nishihara
debugextensions: hide "ships-with-hg-core" magic string (BC)...
r29893 "testedwith": []
liscju
mercurial: add debugextensions command (issue4676)...
r26351 },
{
"buglink": "",
Yuya Nishihara
debugextensions: show ships-with-hg-core state as a separate field...
r29892 "bundled": true,
liscju
mercurial: add debugextensions command (issue4676)...
r26351 "name": "rebase",
Kevin Bullock
test-debugextensions: passes with byte-compilation disabled (issue5147)
r28615 "source": "*/hgext/rebase.py*", (glob)
Yuya Nishihara
debugextensions: hide "ships-with-hg-core" magic string (BC)...
r29893 "testedwith": []
liscju
mercurial: add debugextensions command (issue4676)...
r26351 }
]
Yuya Nishihara
debugextension: change "testedwith" to a list (BC)...
r29703
Yuya Nishihara
test-debugextensions: add dummy extension to make ifcontains() test more solid...
r29891 $ hg debugextensions -T '{ifcontains("3.1", testedwith, "{name}\n")}'
ext2
$ hg debugextensions \
> -T '{ifcontains("3.2", testedwith, "no substring match: {name}\n")}'