Mercurial > public > mercurial-scm > hg
comparison mercurial/hbisect.py @ 15404:c1eb8398fe82
localrepo: convert various repo.set() users to repo.revs()
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 02 Nov 2011 13:51:16 -0500 |
parents | ab341fbb05b1 |
children | 1f677c7e494d |
comparison
equal
deleted
inserted
replaced
15403:e27561eb4a76 | 15404:c1eb8398fe82 |
---|---|
177 # 'range' is all csets that make the bisection: | 177 # 'range' is all csets that make the bisection: |
178 # - have a good ancestor and a bad descendant, or conversely | 178 # - have a good ancestor and a bad descendant, or conversely |
179 # that's because the bisection can go either way | 179 # that's because the bisection can go either way |
180 range = '( bisect(bad)::bisect(good) | bisect(good)::bisect(bad) )' | 180 range = '( bisect(bad)::bisect(good) | bisect(good)::bisect(bad) )' |
181 | 181 |
182 _t = [c.rev() for c in repo.set('bisect(good)::bisect(bad)')] | 182 _t = repo.revs('bisect(good)::bisect(bad)') |
183 # The sets of topologically good or bad csets | 183 # The sets of topologically good or bad csets |
184 if len(_t) == 0: | 184 if len(_t) == 0: |
185 # Goods are topologically after bads | 185 # Goods are topologically after bads |
186 goods = 'bisect(good)::' # Pruned good csets | 186 goods = 'bisect(good)::' # Pruned good csets |
187 bads = '::bisect(bad)' # Pruned bad csets | 187 bads = '::bisect(bad)' # Pruned bad csets |
204 iba = '::bisect(bad) - ::bisect(good)' # Ignored bads' ancestors | 204 iba = '::bisect(bad) - ::bisect(good)' # Ignored bads' ancestors |
205 iga = '::bisect(good) - ::bisect(bad)' # Ignored goods' ancestors | 205 iga = '::bisect(good) - ::bisect(bad)' # Ignored goods' ancestors |
206 ignored = '( ( (%s) | (%s) ) - (%s) )' % (iba, iga, range) | 206 ignored = '( ( (%s) | (%s) ) - (%s) )' % (iba, iga, range) |
207 | 207 |
208 if status == 'range': | 208 if status == 'range': |
209 return [c.rev() for c in repo.set(range)] | 209 return repo.revs(range) |
210 elif status == 'pruned': | 210 elif status == 'pruned': |
211 return [c.rev() for c in repo.set(pruned)] | 211 return repo.revs(pruned) |
212 elif status == 'untested': | 212 elif status == 'untested': |
213 return [c.rev() for c in repo.set(untested)] | 213 return repo.revs(untested) |
214 elif status == 'ignored': | 214 elif status == 'ignored': |
215 return [c.rev() for c in repo.set(ignored)] | 215 return repo.revs(ignored) |
216 elif status == "goods": | 216 elif status == "goods": |
217 return [c.rev() for c in repo.set(goods)] | 217 return repo.revs(goods) |
218 elif status == "bads": | 218 elif status == "bads": |
219 return [c.rev() for c in repo.set(bads)] | 219 return repo.revs(bads) |
220 | |
221 else: | 220 else: |
222 raise error.ParseError(_('invalid bisect state')) | 221 raise error.ParseError(_('invalid bisect state')) |
223 | 222 |
224 def label(repo, node, short=False): | 223 def label(repo, node, short=False): |
225 rev = repo.changelog.rev(node) | 224 rev = repo.changelog.rev(node) |