Patchwork D1286: repoview: also consider visibility exceptions in pinnedrevs

login
register
mail settings
Submitter phabricator
Date Nov. 2, 2017, 6:04 p.m.
Message ID <differential-rev-PHID-DREV-dkjuvddavlocpt3q6vzj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25351/
State Superseded
Headers show

Comments

phabricator - Nov. 2, 2017, 6:04 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This patch make repoview.pinnedrevs() also add visibility exceptions added in
  previous patch.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 29, 2017, 1:13 a.m.
quark requested changes to this revision.
quark added a comment.
This revision now requires changes to proceed.


  This does not work for other repoviews. Why not do it at `filterrevs`?

INLINE COMMENTS

> repoview.py:151
>          func = filtertable[filtername]
>          repo.filteredrevcache[filtername] = func(repo.unfiltered())
>      return repo.filteredrevcache[filtername]

Here, append `- repo.getvisibilityexceptions()`.

REPOSITORY
  rHG Mercurial

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

To: pulkit, #hg-reviewers, quark
Cc: quark, mercurial-devel
phabricator - Dec. 4, 2017, 2:29 p.m.
pulkit abandoned this revision.
pulkit added a comment.


  For record, we just cannot do `- repo.getvisibilityexceptions()` for following reasons:
  
  1. The repo object which we have here can be filtered by different filtername than the filtername for which we are querying filterrevs.
  2. We need to reveal the ancestors of the visibiliity exceptions too, so we must consider the exceptions before we call _revealancestors()

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -37,6 +37,9 @@ 
     pinned.update([par.rev() for par in repo[None].parents()])
     pinned.update([cl.rev(bm) for bm in repo._bookmarks.values()])
 
+    # add the visibility exceptions
+    pinned.update(repo.getvisibilityexceptions())
+
     tags = {}
     tagsmod.readlocaltags(repo.ui, repo, tags, {})
     if tags: