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

Matt Mackall mpm at selenic.com
Fri Jul 10 17:17:53 CDT 2015


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)

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?

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list