README
changeset 66 4129876c8b86
parent 64 30343993578e
equal deleted inserted replaced
65:0bfd48368c17 66:4129876c8b86
    33 the issues subdirectory (instead of the default ``.issues``)::
    33 the issues subdirectory (instead of the default ``.issues``)::
    34 
    34 
    35     [artemis]
    35     [artemis]
    36     issues = _issues
    36     issues = _issues
    37 
    37 
    38 Additionally, one can define colors for the issue list, based on the
    38 Additionally, one can specify filters_ and output formats_.
    39 issues' states. For example::
    39 
    40 
    40 .. _formats:     Format_
    41     new.color           = red
       
    42     new.attrs           = bold
       
    43     resolved.color      = white
       
    44     in-progress.color   = yellow
       
    45     in-progress.attrs   = bold
       
    46 
       
    47 will highlight issues with the state ``new`` as bold red, ``resolved`` issues
       
    48 as white, and ``in-progress`` issues as bold yellow. Artemis uses termcolor_
       
    49 library for the output, see its documentation for color options.
       
    50 
       
    51 .. _`termcolor`:    http://pypi.python.org/pypi/termcolor/
       
    52 
       
    53 
    41 
    54 Example
    42 Example
    55 -------
    43 -------
    56 
    44 
    57 Create an issue::
    45 Create an issue::
   212 
   200 
   213 placed in a file ``.issues/.filter`` creates a filter `olddoc` which can be
   201 placed in a file ``.issues/.filter`` creates a filter `olddoc` which can be
   214 invoked with the `ilist` command::
   202 invoked with the `ilist` command::
   215 
   203 
   216     hg ilist -f olddoc
   204     hg ilist -f olddoc
       
   205 
       
   206 
       
   207 Format
       
   208 ------
       
   209 
       
   210 One can specify the output format for the `ilist` command. The default looks
       
   211 like::
       
   212 
       
   213     [artemis]
       
   214     format = %(id)s (%(len)3d) [%(state)s]: %(subject)s
       
   215 
       
   216 Artemis passes a dictionary with the issue properties to the format string.
       
   217 (Plus ``id`` contains the issue id, and ``len`` contains the number of replies.)
       
   218 
       
   219 It's possible to specify different output formats depending on the properties of
       
   220 the issue. The conditions are encoded in the config variable names as follows::
       
   221 
       
   222     format:state*resolved&resolution*fixed  = %(id)s (%(len)3d) [fixed]: %(Subject)s
       
   223     format:state*resolved                   = %(id)s (%(len)3d) [%(state)s=%(resolution)s]: %(Subject)s
       
   224 
       
   225 The first rule matches issues with the ``state`` property set to ``resolved``
       
   226 and ``resolution`` set to ``fixed``; it abridges the output. The secod rule
       
   227 matches all the ``resolved`` issues (not matched by the first rule); it annotates
       
   228 the issue's state with its ``resolution``.
       
   229 
       
   230 Finally, the dictionary passed to the format string contains a subset of
       
   231 `ANSI codes`_, so one could color the summary lines::
       
   232 
       
   233     format:state*new = %(red)s%(bold)s%(id)s (%(len)3d) [%(state)s]: %(Subject)s%(reset)s
       
   234 
       
   235 .. _`ANSI codes`:       http://en.wikipedia.org/wiki/ANSI_escape_code