D1285: repoview: add a new attribute _visibilityexceptions and related API

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Dec 8 12:07:43 EST 2017


pulkit added a comment.


  In https://phab.mercurial-scm.org/D1285#27808, @yuja wrote:
  
  > > I have spend a lot of time on this and I am unable to make this work without making it class attribute because to calculate filterrevs,  unfilteredrepo is passed and I lose the reference to the object on which I initially stored the visibilityexceptions. If I call `repo.filtered(filtername)`, I am getting a new object with empty visibilityexception set.
  >
  > How long should the visibilityexception be preserved?
  
  
  The visibility exceptions must be preserved until we calculate filteredrevs for that filter. After adding the expections, we clear filteredrevcache to make sure we calculate that again.
  
  > The safest one is to bind it to a temporary filteredrepo object, so that new `.filtered()`
  >  object won't see it.
  > 
  > We could attach it to `unfi`, but in which case, we have to be careful to not leak
  >  the current visibilityexception to the subsequent sessions. A `repo` object may
  >  live longer than a single command/request session in hgweb or command server.
  
  Since we want them while calculating filteredrevs where we pass a unfiltered repo, we need a way to get visibilityexceptions for a filtername from unfi. Maybe we can clear out the exceptions after using them.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1285

To: pulkit, #hg-reviewers, quark, yuja
Cc: yuja, lothiraldan, quark, mercurial-devel


More information about the Mercurial-devel mailing list