[PATCH 4 of 4] changegroup: compute seen files as changesets are added (issue4750)

Gregory Szorc gregory.szorc at gmail.com
Fri Jul 10 18:33:49 CDT 2015


On Fri, Jul 10, 2015 at 3:17 PM, Matt Mackall <mpm at selenic.com> wrote:

> On Thu, 2015-07-09 at 17:09 -0700, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc at gmail.com>
> > # Date 1436485900 25200
> > #      Thu Jul 09 16:51:40 2015 -0700
> > # Node ID e86c10381256d2996583f7978c9b1b7f636ec1d8
> > # Parent  c9abd93973708d02d7a945cbddaba9b420a18cfa
> > changegroup: compute seen files as changesets are added (issue4750)
>
> This all looks pretty good, but it seems like it'd be much tidier as a
> callback on addgroup:
>
> seen = set()
> def mycallback(revlog, rev, text):
>    seen.update(changelogmod.parse(text)[3]) # instead of _newchangelog
>
> srccontent = cl.addgroup(source, csmap, trp, mycallback)
>

I like this idea and will incorporate it.


>
> Also, I'm not sure it's not just easier to fetch a revision right after
> addrevision rather than have addrevision have a weird calling pattern.
> After all, we cache the latest text when it's available, right?
>
> So the above becomes:
>
> def mycallback(cl, rev):
>    seen.update(cl.read(rev)[3])
>
> ..and a lot of extra mechanics goes away?
>
>
I initially tried this or something like this. However, I was getting
errors due to some weird I/O issue that kinda seemed like something was
trying to read from the revlog or index before data had been written or
flushed or something. But I can't reproduce it right now. So maybe I was
just doing things wrong. It took a few iterations of this to make it happy.
I'll try your approach and see what happens.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150710/3aa63581/attachment.html>


More information about the Mercurial-devel mailing list