comparison mercurial/help/revsets.txt @ 14098:9f5a0acb0056

revset aliases
author Alexander Solovyov <alexander@solovyov.net>
date Sat, 30 Apr 2011 18:30:14 +0200
parents 305c97670d7a
children 0be6dc3d8083
comparison
equal deleted inserted replaced
14097:ca3376f044f8 14098:9f5a0acb0056
59 59
60 The following predicates are supported: 60 The following predicates are supported:
61 61
62 .. predicatesmarker 62 .. predicatesmarker
63 63
64 New predicates (known as "aliases") can be defined, using any combination of
65 existing predicates or other aliases. An alias definition looks like::
66
67 <alias> = <definition>
68
69 in the ``revsetalias`` section of ``.hgrc``. Arguments of the form `$1`, `$2`,
70 etc. are substituted from the alias into the definition.
71
72 For example,
73
74 ::
75
76 [revsetalias]
77 h = heads()
78 d($1) = sort($1, date)
79 rs($1, $2) = reverse(sort($1, $2))
80
81 defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is
82 exactly equivalent to ``reverse(sort(0:tip, author))``.
83
64 Command line equivalents for :hg:`log`:: 84 Command line equivalents for :hg:`log`::
65 85
66 -f -> ::. 86 -f -> ::.
67 -d x -> date(x) 87 -d x -> date(x)
68 -k x -> keyword(x) 88 -k x -> keyword(x)