Next: Attribute Handling, Previous: External Merge Tools, Up: Hooks [Contents][Index]
Monotone’s selectors are a powerful mechanism used to refer to revisions with symbolic names or groupings. Thanks to the hooks described in this section, it is possible to use various forms of shorthand in selection strings; these hooks are designed to recognise shorthand patterns and expand them to their full form.
For more detail on the use of selectors, see Selectors.
expand_selector (str)
Called by any command that can take a selector argument, for each
element of a combined selector string (between /
separators).
The input str is the command line argument. The hook should return a string that is a valid monotone selector.
Expansion generally means providing a type prefix for the selector,
such as a:
for authors or d:
for dates.
The default definition of this hook attempts to recognize certs, email addresses, branch names, hex ids, and dates, and adds the appropriate prefix. See Default hooks.
expand_date (str)
Called when processing a date selector (d:
).
The input str is the command line selector, after processing by
expand_selector
. The hook should return a date that can be
used by a standard SQL select statement.
The default hook recognizes special words such as yesterday
or
6 months ago
and converts them into well formed date
expressions. See Default hooks.