formatter: improve implementation of data method
This alternate syntax was proposed by Bryan O'Sullivan in a review of
772b3764d3e8. I haven't been able to measure any particular performance
difference, but the new syntax is more concise and easier to read.
--- a/mercurial/formatter.py Wed Sep 19 09:38:51 2012 -0700
+++ b/mercurial/formatter.py Thu Sep 20 23:30:59 2012 -0400
@@ -26,8 +26,7 @@
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
+ self._item.update(data)
def write(self, fields, deftext, *fielddata, **opts):
'''do default text output while assigning data to item'''
for k, v in zip(fields.split(), fielddata):