mercurial/templates/map-cmdline.show
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 03 Aug 2017 21:51:34 -0700
changeset 34202 4441c1113eb2
parent 33199 c5a07a3abe7d
child 34714 f4aeb952ab77
permissions -rw-r--r--
show: pass the minimum length for nodes as a template keyword This will allow us to make the displayed length configurable and/or dynamic. Differential Revision: https://phab.mercurial-scm.org/D556
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32059
0ea1d9a750da show: add basic labels to work template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32058
diff changeset
     1
# TODO there are a few deficiencies in this file:
0ea1d9a750da show: add basic labels to work template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32058
diff changeset
     2
# * The "namespace" of the labels needs to be worked out. We currently
0ea1d9a750da show: add basic labels to work template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32058
diff changeset
     3
#   piggyback on existing values so color works.
0ea1d9a750da show: add basic labels to work template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32058
diff changeset
     4
# * Obsolescence isn't considered for node labels. See _cset_labels in
0ea1d9a750da show: add basic labels to work template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32058
diff changeset
     5
#   map-cmdline.default.
34202
4441c1113eb2 show: pass the minimum length for nodes as a template keyword
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33199
diff changeset
     6
showbookmarks = '{if(active, "*", " ")} {pad(bookmark, longestbookmarklen + 4)}{shortest(node, nodelen)}\n'
33058
11f768258dcc show: construct changeset templater during dispatch
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32059
diff changeset
     7
33062
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
     8
showwork = '{cset_shortnode}{namespaces % cset_namespace} {cset_shortdesc}'
33199
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33062
diff changeset
     9
showstack = '{showwork}'
33058
11f768258dcc show: construct changeset templater during dispatch
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32059
diff changeset
    10
34202
4441c1113eb2 show: pass the minimum length for nodes as a template keyword
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33199
diff changeset
    11
cset_shortnode = '{label("log.changeset changeset.{phase}", shortest(node, nodelen))}'
33062
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
    12
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
    13
# Treat branch and tags specially so we don't display "default" or "tip"
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
    14
cset_namespace = '{ifeq(namespace, "branches", names_branches, ifeq(namespace, "tags", names_tags, names_others))}'
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
    15
names_branches = '{ifeq(branch, "default", "", " ({label('log.{colorname}', branch)})")}'
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
    16
names_tags = '{if(names % "{ifeq(name, 'tip', '', name)}", " ({label('log.{colorname}', join(names % "{ifeq(name, 'tip', '', name)}", ' '))})")}'
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
    17
names_others = '{if(names, " ({label('log.{colorname}', join(names, ' '))})")}'
0a507da7d8ea show: show all namespaces in "work" view
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33058
diff changeset
    18
33058
11f768258dcc show: construct changeset templater during dispatch
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32059
diff changeset
    19
cset_shortdesc = '{label("log.description", desc|firstline)}'