[PATCH 0 of 4] Add mechanisme for extension to extend default changeset log format.

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jun 11 07:31:58 CDT 2011


This series add mechanism in cmdutils.changeset_printer to help extentions who
want to add new field for log.

The first patches add the mechanism itself, the other make mq and transplant use it.

I won't hide that using it for mq and transplant is mostly for test purpose as
my main objective is to display "state" and "obsolet" related stuff. However I
found that it make sense for mq and transplant too.

About the mechanism itself I had two options in mind. In both I add a
``extensionsfields`` method to ``changeset_printer``. The question is what this
extensions should do.

Option 1
--------
(The one in this series)

``extensionsfields`` return a 2 or 3 tuple ``(field-name, value, [, label])``
processed by generic code in ``changeset_printer``

Pro:
    * Easier to use by extensions (simple extension capability is often
                                   highlight in dvs comparative)
    * Allow extensions to interract with each other by altering the list built
      by other.

Cons:
    * limited to one liner field "<name>:    <value>"
    * more complex for i18n detection: <<< _("%-13s%%s\n" % (fieldname + ':')) >>>

Option 2
--------

``extensionsfields`` is responsible to call for ui.write.

Pro and Cons are the opposite of Option 1.


More information about the Mercurial-devel mailing list