[PATCH 1 of 6] changegroup: expose outgoing instance from getchangegroupraw

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Jun 1 00:06:59 CDT 2015



On 05/31/2015 05:28 PM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1432592438 25200
> #      Mon May 25 15:20:38 2015 -0700
> # Node ID c86d558a097b3bb6a5d6a3423518984d9dd70898
> # Parent  4cc3fb23881d9abc7745501ef0d777e5976ddb52
> changegroup: expose outgoing instance from getchangegroupraw
>
> Currently, consumers to getchangegroupraw have no way of knowing what
> changesets are included without reading the output stream. This is
> extra work and inefficient.
>
> Change the API of getchangegroupraw to return the computed
> discovery.outgoing instance, which contains a "missing" property that
> holds the list of changesets in the changegroup.

This is moving in the wrong direction. The `getchangegroupraw` 2 line 
long and is called in twice in a single place. Replacing this call with 
and explicit creation of 'outgoing' (from the same function) and a call 
to the function underlying getchangegroupraw would give you the same 
result without the need for torturing this version of the function. 
(instead you could just kill that version of the function).

This will be a net win for code simplicity and clarity.


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list