Show More
@@ -618,9 +618,14 b' def shownamespaces(**args):' | |||||
618 | repo = ctx.repo() |
|
618 | repo = ctx.repo() | |
619 |
|
619 | |||
620 | namespaces = util.sortdict() |
|
620 | namespaces = util.sortdict() | |
|
621 | def makensmapfn(ns): | |||
|
622 | # 'name' for iterating over namespaces, templatename for local reference | |||
|
623 | return lambda v: {'name': v, ns.templatename: v} | |||
621 |
|
624 | |||
622 | for k, ns in repo.names.iteritems(): |
|
625 | for k, ns in repo.names.iteritems(): | |
623 |
names |
|
626 | names = ns.names(repo, ctx.node()) | |
|
627 | f = _showlist('name', names, args) | |||
|
628 | namespaces[k] = _hybrid(f, names, makensmapfn(ns), pycompat.identity) | |||
624 |
|
629 | |||
625 | f = _showlist('namespace', list(namespaces), args) |
|
630 | f = _showlist('namespace', list(namespaces), args) | |
626 |
|
631 |
@@ -4130,6 +4130,9 b' Test namespaces dict' | |||||
4130 | $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}' |
|
4130 | $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}' | |
4131 | bar |
|
4131 | bar | |
4132 | foo |
|
4132 | foo | |
|
4133 | $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}' | |||
|
4134 | bar | |||
|
4135 | foo | |||
4133 |
|
4136 | |||
4134 | Test stringify on sub expressions |
|
4137 | Test stringify on sub expressions | |
4135 |
|
4138 |
General Comments 0
You need to be logged in to leave comments.
Login now