# HG changeset patch # User Pierre-Yves David # Date 1400888790 25200 # Node ID e55888447958098e82a477f320522a122131b8d3 # Parent f9dabfceb259d643abe650256a4eee1cd5df78ec bundle2: update part creators to ``addparam`` when relevant In some cases, the use of ``addparam`` makes code much clearer. diff -r f9dabfceb259 -r e55888447958 mercurial/bundle2.py --- a/mercurial/bundle2.py Thu May 22 11:38:40 2014 -0700 +++ b/mercurial/bundle2.py Fri May 23 16:46:30 2014 -0700 @@ -325,10 +325,8 @@ if output is not None: output = op.ui.popbuffer() if output: - op.reply.newpart('b2x:output', - advisoryparams=[('in-reply-to', - str(part.id))], - data=output) + outpart = op.reply.newpart('b2x:output', data=output) + outpart.addparam('in-reply-to', str(part.id), mandatory=False) part.read() except Exception, exc: if part is not None: @@ -769,9 +767,9 @@ if op.reply is not None: # This is definitly not the final form of this # return. But one need to start somewhere. - op.reply.newpart('b2x:reply:changegroup', (), - [('in-reply-to', str(inpart.id)), - ('return', '%i' % ret)]) + part = op.reply.newpart('b2x:reply:changegroup') + part.addparam('in-reply-to', str(inpart.id), mandatory=False) + part.addparam('return', '%i' % ret, mandatory=False) assert not inpart.read() @parthandler('b2x:reply:changegroup')