<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 10, 2015 at 3:17 PM, Matt Mackall <span dir="ltr"><<a href="mailto:mpm@selenic.com" target="_blank">mpm@selenic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, 2015-07-09 at 17:09 -0700, Gregory Szorc wrote:<br>
> # HG changeset patch<br>
> # User Gregory Szorc <<a href="mailto:gregory.szorc@gmail.com">gregory.szorc@gmail.com</a>><br>
> # Date 1436485900 25200<br>
> #      Thu Jul 09 16:51:40 2015 -0700<br>
> # Node ID e86c10381256d2996583f7978c9b1b7f636ec1d8<br>
> # Parent  c9abd93973708d02d7a945cbddaba9b420a18cfa<br>
> changegroup: compute seen files as changesets are added (issue4750)<br>
<br>
</span>This all looks pretty good, but it seems like it'd be much tidier as a<br>
callback on addgroup:<br>
<br>
seen = set()<br>
def mycallback(revlog, rev, text):<br>
   seen.update(changelogmod.parse(text)[3]) # instead of _newchangelog<br>
<br>
srccontent = cl.addgroup(source, csmap, trp, mycallback)<br></blockquote><div><br></div><div>I like this idea and will incorporate it.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Also, I'm not sure it's not just easier to fetch a revision right after<br>
addrevision rather than have addrevision have a weird calling pattern.<br>
After all, we cache the latest text when it's available, right?<br>
<br>
So the above becomes:<br>
<br>
def mycallback(cl, rev):<br>
   seen.update(cl.read(rev)[3])<br>
<br>
..and a lot of extra mechanics goes away?<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></blockquote><div><br></div><div>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. <br></div></div><br></div></div>