[PATCH 3 of 3] phabricator: add phabread command to read patches

Jun Wu quark at fb.com
Mon Jul 3 18:16:06 EDT 2017


Excerpts from Kevin Bullock's message of 2017-07-03 13:27:56 -0500:
> > On Jul 2, 2017, at 22:10, Jun Wu <quark at fb.com> wrote:
> > 
> > # HG changeset patch
> > # User Jun Wu <quark at fb.com>
> > # Date 1499051289 25200
> > #      Sun Jul 02 20:08:09 2017 -0700
> > # Node ID ee0c338d2115294aba8d844d62b9615d48517b94
> > # Parent  edb97a6c5f1065227180e41010076ad09697b408
> > # Available At https://bitbucket.org/quark-zju/hg-draft 
> > #              hg pull https://bitbucket.org/quark-zju/hg-draft  -r ee0c338d2115
> > phabricator: add phabread command to read patches
> 
> Queued, thanks! Some notes inline.

Thanks for the quick response!

> > +    # Check dependencies
> > +    if recursive:
> > +        auxiliary = drev.get(r'auxiliary', {})
> > +        depends = auxiliary.get(r'phabricator:depends-on', [])
> > +        for phid in depends:
> > +            patch = readpatch(repo, {'phids': [phid]}, recursive=True) + patch
> > +    return patch
> 
> While the repeated API calls we need to do lend themselves to a recursive
> function, I worry about the memory usage this will cause on large series.
> For follow-up, could you make it so that we're calling the API
> iteratively, and print each patch as it comes in? Maybe with a custom
> iterator?

Sure. This version is mostly to make things work. If we figure out the stack
relationship first, we can use batch API (passing multiple IDs per call) to
get the patches using less round-trips.

> pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
> Kevin R. Bullock


More information about the Mercurial-devel mailing list