Mercurial > public > mercurial-scm > hg
comparison mercurial/hbisect.py @ 15147:395ca8cd2669
revset.bisect: add 'ignored' set to the bisect keyword
The 'ignored' changesets are outside the bisection range, but are
changesets that may have an impact on the outcome of the bisection.
For example, in case there's a merge between the good and bad csets,
but the branch-point is out of the bisection range, and the issue
originates from this branch, the branch will not be visited by bisect
and bisect will find that the culprit cset is the merge.
So, the 'ignored' set is equivalent to:
( ( ::bisect(bad) - ::bisect(good) )
| ( ::bisect(good) - ::bisect(bad) ) )
- bisect(range)
- all ancestors of bad csets that are not ancestors of good csets, or
- all ancestors of good csets that are not ancestors of bad csets
- but that are not in the bisection range.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
author | "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> |
---|---|
date | Tue, 20 Sep 2011 20:21:04 +0200 |
parents | b39d85be78a8 |
children | fa0a464e4ca5 |
comparison
equal
deleted
inserted
replaced
15146:b39d85be78a8 | 15147:395ca8cd2669 |
---|---|
160 | 160 |
161 - ``good``, ``bad``, ``skip``: as the names imply | 161 - ``good``, ``bad``, ``skip``: as the names imply |
162 - ``range`` : all csets taking part in the bisection | 162 - ``range`` : all csets taking part in the bisection |
163 - ``pruned`` : csets that are good, bad or skipped | 163 - ``pruned`` : csets that are good, bad or skipped |
164 - ``untested`` : csets whose fate is yet unknown | 164 - ``untested`` : csets whose fate is yet unknown |
165 - ``ignored`` : csets ignored due to DAG topology | |
165 """ | 166 """ |
166 state = load_state(repo) | 167 state = load_state(repo) |
167 if status in ('good', 'bad', 'skip'): | 168 if status in ('good', 'bad', 'skip'): |
168 return [repo.changelog.rev(n) for n in state[status]] | 169 return [repo.changelog.rev(n) for n in state[status]] |
169 else: | 170 else: |
189 pruned = '( (%s) | (%s) | (%s) )' % (pg, pb, ps) | 190 pruned = '( (%s) | (%s) | (%s) )' % (pg, pb, ps) |
190 | 191 |
191 # 'untested' is all cset that are- in 'range', but not in 'pruned' | 192 # 'untested' is all cset that are- in 'range', but not in 'pruned' |
192 untested = '( (%s) - (%s) )' % (range, pruned) | 193 untested = '( (%s) - (%s) )' % (range, pruned) |
193 | 194 |
195 # 'ignored' is all csets that were not used during the bisection | |
196 # due to DAG topology, but may however have had an impact. | |
197 # Eg., a branch merged between bads and goods, but whose branch- | |
198 # point is out-side of the range. | |
199 iba = '::bisect(bad) - ::bisect(good)' # Ignored bads' ancestors | |
200 iga = '::bisect(good) - ::bisect(bad)' # Ignored goods' ancestors | |
201 ignored = '( ( (%s) | (%s) ) - (%s) )' % (iba, iga, range) | |
202 | |
194 if status == 'range': | 203 if status == 'range': |
195 return [c.rev() for c in repo.set(range)] | 204 return [c.rev() for c in repo.set(range)] |
196 elif status == 'pruned': | 205 elif status == 'pruned': |
197 return [c.rev() for c in repo.set(pruned)] | 206 return [c.rev() for c in repo.set(pruned)] |
198 elif status == 'untested': | 207 elif status == 'untested': |
199 return [c.rev() for c in repo.set(untested)] | 208 return [c.rev() for c in repo.set(untested)] |
209 elif status == 'ignored': | |
210 return [c.rev() for c in repo.set(ignored)] | |
200 | 211 |
201 else: | 212 else: |
202 raise error.ParseError(_('invalid bisect state')) | 213 raise error.ParseError(_('invalid bisect state')) |