<div dir="ltr"><div class="gmail_extra">On Thu, Jun 13, 2013 at 6:06 AM, Pierre-Yves David <span dir="ltr"><<a href="mailto:pierre-yves.david@logilab.fr" target="_blank">pierre-yves.david@logilab.fr</a>></span> wrote:<br>


<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="overflow:hidden">This is not supposed to happen. The repoview object should just proxy<br>



everything to the original localrepo object.<br></div></blockquote><div><br></div><div>Every access to <a href="http://repo.mq" target="_blank">repo.mq</a> results in a new mq.queue object being created and destroyed. I don't know quite why this is happening, but I can see it clearly.</div>


<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="overflow:hidden">I'm not saying that repoview can't be bugged. But it should not prevent you<br>



from doing what you are trying to.<br></div></blockquote></div><br></div><div class="gmail_extra">Since I can't maintain any state on the repo object (because mq is deleted and recreated every time I access it), it is very definitely preventing me from doing what I am trying to do :-)</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">Here is what I can reconstruct so far.</div><div class="gmail_extra"><br></div><div class="gmail_extra">When I ask for <a href="http://repo.mq" target="_blank">repo.mq</a>, this ends up invoking propertycache.__get__ on a localrepo.proxycls object.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">That tries to setattr the attribute, which (via inheritance) calls repoview.repoview.__setattr__. This seems to set the field on the mq.mqrepo object correctly, but next time the attribute is retrieved, the propertycache.__get__ method is called again, a new object is created as a result, and the previous one is deleted once the attribute is set again.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">In other words, something bizarre is absolutely definitely happening with that complicated interaction between proxycls, propertycache, and repoview. I don't understand it, and I don't have time to dig deeper, but it's easy to reproduce.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Here is a trivial repro: <a href="http://pastebin.com/GshjKqCW">http://pastebin.com/GshjKqCW</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">
You can trigger this by applying the patch and running "hg tip". You'll see that it prints "new queue" four times, indicating that a new queue object is being constructed every time <a href="http://self.mq">self.mq</a> is being accessed.</div>
</div>