Submitter | phabricator |
---|---|
Date | Oct. 11, 2017, 7:10 p.m. |
Message ID | <differential-rev-PHID-DREV-gsujq6zgu4kpgle4353r-req@phab.mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/24752/ |
State | Superseded |
Headers | show |
Comments
dlax requested changes to this revision. dlax added a comment. This revision now requires changes to proceed. The idea of using different names to control the behavior of the filter function sounds strange to me. Maybe `repoview.filterrevs()` could accept `**kwargs` that would be passed to the function in `repoview.filtertable`? diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -146,11 +146,11 @@ filtertable = {'visible': computehidden, 'immutable': computemutable, 'base': computeimpactable} -def filterrevs(repo, filtername): +def filterrevs(repo, filtername, **kwargs): """returns set of filtered revision for this filter name""" if filtername not in repo.filteredrevcache: func = filtertable[filtername] - repo.filteredrevcache[filtername] = func(repo.unfiltered()) + repo.filteredrevcache[filtername] = func(repo.unfiltered(), **kwargs) return repo.filteredrevcache[filtername] class repoview(object): Then you'd call `repoview.filterrevs(repo, 'visible', warn=True)` assuming `computehidden` accepts a `warn` keyword argument. (Also having an actual use of the new behavior in the patch series would help understanding the intent.) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1012 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel
dlax added a comment.
In https://phab.mercurial-scm.org/D1012#17020, @dlax wrote:
> (Also having an actual use of the new behavior in the patch series would help understanding the intent.)
Hm, I now see it's used in some other differentials but they do not appear in this stack :(
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1012
To: pulkit, #hg-reviewers, dlax
Cc: dlax, mercurial-devel
pulkit added a comment. In https://phab.mercurial-scm.org/D1012#17023, @dlax wrote: > In https://phab.mercurial-scm.org/D1012#17020, @dlax wrote: > > > (Also having an actual use of the new behavior in the patch series would help understanding the intent.) > > > Hm, I now see it's used in some other differentials but they do not appear in this stack :( Yeah I am also sad about that. I will resend them as a new stack fixing some minor comments from others. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1012 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel
pulkit abandoned this revision. pulkit added a comment. Resend the series as https://phab.mercurial-scm.org/D1140 - https://phab.mercurial-scm.org/D1144. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1012 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel
Patch
diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -139,6 +139,8 @@ # Otherwise your filter will have to recompute all its branches cache # from scratch (very slow). filtertable = {'visible': computehidden, + 'visible-warnhidden': computehidden, + 'visible-hidden': computehidden, 'served': computeunserved, 'immutable': computemutable, 'base': computeimpactable} diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -86,7 +86,9 @@ subsettable = {None: 'visible', 'visible': 'served', 'served': 'immutable', - 'immutable': 'base'} + 'immutable': 'base', + 'visible-warnhidden': 'visible', + 'visible-hidden': 'visible'} def updatecache(repo): cl = repo.changelog