Mercurial > hg
comparison mercurial/repoview.py @ 50772:1680ef94ad2b stable
repoview: fix the filter created by `extrafilter`
The `name` variable was updated in each interaction of the loop, making all new
filters inheriting from the same base (the last one iterated), leading to
terrible terrible misbehavior.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 12 Jul 2023 12:47:08 +0200 |
parents | d44e3c45f0e4 |
children | d718eddf01d9 |
comparison
equal
deleted
inserted
replaced
50771:d24573181003 | 50772:1680ef94ad2b |
---|---|
207 combine = lambda fname: fname + b'%' + fid | 207 combine = lambda fname: fname + b'%' + fid |
208 | 208 |
209 subsettable = repoviewutil.subsettable | 209 subsettable = repoviewutil.subsettable |
210 | 210 |
211 if combine(b'base') not in filtertable: | 211 if combine(b'base') not in filtertable: |
212 for name in _basefiltername: | 212 for base_name in _basefiltername: |
213 | 213 |
214 def extrafilteredrevs(repo, *args, **kwargs): | 214 def extrafilteredrevs(repo, *args, name=base_name, **kwargs): |
215 baserevs = filtertable[name](repo, *args, **kwargs) | 215 baserevs = filtertable[name](repo, *args, **kwargs) |
216 extrarevs = frozenset(repo.revs(frevs)) | 216 extrarevs = frozenset(repo.revs(frevs)) |
217 return baserevs | extrarevs | 217 return baserevs | extrarevs |
218 | 218 |
219 filtertable[combine(name)] = extrafilteredrevs | 219 filtertable[combine(base_name)] = extrafilteredrevs |
220 if name in subsettable: | 220 if base_name in subsettable: |
221 subsettable[combine(name)] = combine(subsettable[name]) | 221 subsettable[combine(base_name)] = combine( |
222 subsettable[base_name] | |
223 ) | |
222 return fid | 224 return fid |
223 | 225 |
224 | 226 |
225 def filterrevs(repo, filtername, visibilityexceptions=None): | 227 def filterrevs(repo, filtername, visibilityexceptions=None): |
226 """returns set of filtered revision for this filter name | 228 """returns set of filtered revision for this filter name |