nCoda Lychee Docs

Version Control Data

“Converts” VCS data into an easier format for clients.


This module is intended for internal Lychee use only, so the API may change without notice. If you wish to use this module outside Lychee, please contact us to discuss the best way.


We recommend that you use the converters indirectly. Refer to How to Use the Converters for more information.


This is an outbound converter that does not emit signals directly. Refer to the lychee.signals.outbound module for more information.

Here is a sample of the data outputted from this module.

    # "history" is the order of changelogs leading to the current tip
    'history': ['529003fcbb3d8394f324bbd6ccb5586101864cbb', '41962ee9069382d1fbbba5251ee0b5de99b18df6'],
    # "users" is a dict where keys are the users responsible for a changelog leading to the current
    #    tip, and values are a list of their changesets
    'users': {
        'Fortitude Johnson <>': ['529003fcbb3d8394f324bbd6ccb5586101864cbb'],
        'Danceathon Smith <>': ['41962ee9069382d1fbbba5251ee0b5de99b18df6'],
    # "changesets" is a dict of dicts with information about changesets
    'changesets': {
        '529003fcbb3d8394f324bbd6ccb5586101864cbb': {
            'hash': '529003fcbb3d8394f324bbd6ccb5586101864cbb',
            'user': 'Fortitude Johnson <>',
            # "date" as a Unix timestamp in UTC...
            # ... multiply by 1000 for JavaScript's Date.setTime()
            'date': 1424721600.0,
            # list of "score" and/or @xml:id of affected <section> elements
            'files': ['score'],
            'description': 'Add "section_B.mei" to all_files and score',
            'number': '0',
        '41962ee9069382d1fbbba5251ee0b5de99b18df6': {
            'hash': '41962ee9069382d1fbbba5251ee0b5de99b18df6',
            'user': 'Danceathon Smith <>',
            'date': 1424894400.0,
            'files': ['270842928'],
            'description': 'Add section C1',
            'number': '1',
lychee.converters.outbound.vcs.convert(repo_dir, **kwargs)[source]

Prepare VCS data in a useful format for clients.

Parameters:repo_dir (str) – The absolute pathname to the repository for which to produce data.
Raises:lychee.exceptions.OutboundConversionError when there is a forseeable error.

Dummy replacement for convert_helper while VCS is disabled.


Do the actual work for convert(). This helper function exists so that the document_outbound converter can call this converter without having to emit the CONVERSION_FINISH signal.

Parameters:repo_dir (str) – Absolute pathname to the Mercurial repository’s directory.
Returns:Information from the Version Control System in the format described above.
Return type:dict


If the repository fails to initialize for any reason, this function returns an empty dictionary rather than raising an exception.


Given the list of files modified, prepare the output for Julius.

This removes the “.mei” extension for everything except “all_files.mei,” which is not returned.