[PATCH 2 of 4 RFC V2] formatter: add base implementation of data method

David Carr davidmc24 at gmail.com
Sun Sep 16 00:44:58 CDT 2012


# HG changeset patch
# User David M. Carr  <david at carrclan.us>
# Date 1347763834 14400
# Node ID 49bf6af6f2eaa291c343e609d1550ddce1cfe0ec
# Parent  91e6470b474c43967d357e225447dc540b02bd2d
formatter: add base implementation of data method

Previously, nothing was done with the passed in values, which clearly wasn't
the intention.

diff --git a/mercurial/formatter.py b/mercurial/formatter.py
--- a/mercurial/formatter.py
+++ b/mercurial/formatter.py
@@ -26,6 +26,8 @@
         self._item = {}
     def data(self, **data):
         '''insert data into item that's not shown in default output'''
+        for k, v in data.iteritems():
+            self._item[k] = v
     def write(self, fields, deftext, *fielddata, **opts):
         '''do default text output while assigning data to item'''
         for k, v in zip(fields.split(), fielddata):


More information about the Mercurial-devel mailing list