##// END OF EJS Templates
revset.bisect: add new 'range' set to the bisect keyword...
"Yann E. MORIN" -
r15136:18219c07 default
parent child Browse files
Show More
@@ -159,9 +159,37 b' def get(repo, status):'
159 Return a list of revision(s) that match the given status:
159 Return a list of revision(s) that match the given status:
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 """
163 """
163 state = load_state(repo)
164 state = load_state(repo)
164 if status in ('good', 'bad', 'skip'):
165 if status in ('good', 'bad', 'skip'):
165 return [repo.changelog.rev(n) for n in state[status]]
166 return [repo.changelog.rev(n) for n in state[status]]
166 else:
167 else:
167 raise error.ParseError(_('invalid bisect state'))
168 # Build sets of good, bad, and skipped csets
169 goods = set(repo.changelog.rev(n) for n in state['good'])
170 bads = set(repo.changelog.rev(n) for n in state['bad'])
171 skips = set(repo.changelog.rev(n) for n in state['skip'])
172
173 # Build kinship of good csets
174 ga = goods.copy() # Goods' Ancestors
175 gd = goods.copy() # Goods' Descendants
176 for g in goods:
177 ga |= set(repo.changelog.ancestors(g))
178 gd |= set(repo.changelog.descendants(g))
179
180 # Build kinship of bad csets
181 ba = bads.copy() # Bads' Ancestors
182 bd = bads.copy() # Bads' Descendants
183 for b in bads:
184 ba |= set(repo.changelog.ancestors(b))
185 bd |= set(repo.changelog.descendants(b))
186
187 # Build the range of the bisection
188 range = set(c for c in ba if c in gd)
189 range |= set(c for c in ga if c in bd)
190
191 if status == 'range':
192 return [c for c in range]
193
194 else:
195 raise error.ParseError(_('invalid bisect state'))
@@ -237,7 +237,10 b' def author(repo, subset, x):'
237
237
238 def bisect(repo, subset, x):
238 def bisect(repo, subset, x):
239 """``bisect(string)``
239 """``bisect(string)``
240 Changesets marked in the specified bisect status (good, bad, skip).
240 Changesets marked in the specified bisect status (``good``, ``bad``,
241 ``skip``), or any of the meta-status:
242
243 - ``range`` : all csets taking part in the bisection
241 """
244 """
242 status = getstring(x, _("bisect requires a string")).lower()
245 status = getstring(x, _("bisect requires a string")).lower()
243 return [r for r in subset if r in hbisect.get(repo, status)]
246 return [r for r in subset if r in hbisect.get(repo, status)]
@@ -271,6 +271,23 b' complex bisect test 1 # first bad rev i'
271 date: Thu Jan 01 00:00:09 1970 +0000
271 date: Thu Jan 01 00:00:09 1970 +0000
272 summary: 9
272 summary: 9
273
273
274 $ hg log -q -r 'bisect(range)'
275 0:33b1f9bc8bc5
276 1:4ca5088da217
277 2:051e12f87bf1
278 3:0950834f0a9c
279 4:5c668c22234f
280 5:385a529b6670
281 6:a214d5d3811a
282 8:dab8161ac8fc
283 9:3c77083deb4a
284 10:429fcd26f52d
285 11:82ca6f06eccd
286 12:9f259202bbe7
287 13:b0a32c86eb31
288 15:857b178a7cf3
289 16:609d82a7ebae
290 17:228c06deef46
274
291
275 complex bisect test 2 # first good rev is 13
292 complex bisect test 2 # first good rev is 13
276
293
@@ -295,6 +312,21 b' complex bisect test 2 # first good rev '
295 date: Thu Jan 01 00:00:13 1970 +0000
312 date: Thu Jan 01 00:00:13 1970 +0000
296 summary: 13
313 summary: 13
297
314
315 $ hg log -q -r 'bisect(range)'
316 1:4ca5088da217
317 2:051e12f87bf1
318 3:0950834f0a9c
319 4:5c668c22234f
320 5:385a529b6670
321 6:a214d5d3811a
322 8:dab8161ac8fc
323 9:3c77083deb4a
324 10:429fcd26f52d
325 11:82ca6f06eccd
326 12:9f259202bbe7
327 13:b0a32c86eb31
328 15:857b178a7cf3
329 18:d42e18c7bc9b
298
330
299 complex bisect test 3
331 complex bisect test 3
300
332
@@ -347,6 +379,21 b' 10,9,13 are skipped an might be the firs'
347 date: Thu Jan 01 00:00:15 1970 +0000
379 date: Thu Jan 01 00:00:15 1970 +0000
348 summary: merge 10,13
380 summary: merge 10,13
349
381
382 $ hg log -q -r 'bisect(range)'
383 1:4ca5088da217
384 2:051e12f87bf1
385 3:0950834f0a9c
386 4:5c668c22234f
387 5:385a529b6670
388 6:a214d5d3811a
389 8:dab8161ac8fc
390 9:3c77083deb4a
391 10:429fcd26f52d
392 11:82ca6f06eccd
393 12:9f259202bbe7
394 13:b0a32c86eb31
395 15:857b178a7cf3
396 16:609d82a7ebae
350
397
351 complex bisect test 4
398 complex bisect test 4
352
399
@@ -386,6 +433,16 b' 15,16 are skipped an might be the first '
386 date: Thu Jan 01 00:00:17 1970 +0000
433 date: Thu Jan 01 00:00:17 1970 +0000
387 summary: 17
434 summary: 17
388
435
436 $ hg log -q -r 'bisect(range)'
437 8:dab8161ac8fc
438 9:3c77083deb4a
439 10:429fcd26f52d
440 11:82ca6f06eccd
441 12:9f259202bbe7
442 13:b0a32c86eb31
443 15:857b178a7cf3
444 16:609d82a7ebae
445 17:228c06deef46
389
446
390 test unrelated revs:
447 test unrelated revs:
391
448
@@ -394,6 +451,7 b' test unrelated revs:'
394 $ hg bisect -g 14
451 $ hg bisect -g 14
395 abort: starting revisions are not directly related
452 abort: starting revisions are not directly related
396 [255]
453 [255]
454 $ hg log -q -r 'bisect(range)'
397 $ hg bisect --reset
455 $ hg bisect --reset
398
456
399 end at merge: 17 bad, 11 good (but 9 is first bad)
457 end at merge: 17 bad, 11 good (but 9 is first bad)
@@ -418,6 +476,13 b' end at merge: 17 bad, 11 good (but 9 is '
418 Not all ancestors of this changeset have been checked.
476 Not all ancestors of this changeset have been checked.
419 Use bisect --extend to continue the bisection from
477 Use bisect --extend to continue the bisection from
420 the common ancestor, dab8161ac8fc.
478 the common ancestor, dab8161ac8fc.
479 $ hg log -q -r 'bisect(range)'
480 11:82ca6f06eccd
481 12:9f259202bbe7
482 13:b0a32c86eb31
483 15:857b178a7cf3
484 16:609d82a7ebae
485 17:228c06deef46
421 $ hg bisect --extend
486 $ hg bisect --extend
422 Extending search to changeset 8:dab8161ac8fc
487 Extending search to changeset 8:dab8161ac8fc
423 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
@@ -431,6 +496,16 b' end at merge: 17 bad, 11 good (but 9 is '
431 date: Thu Jan 01 00:00:09 1970 +0000
496 date: Thu Jan 01 00:00:09 1970 +0000
432 summary: 9
497 summary: 9
433
498
499 $ hg log -q -r 'bisect(range)'
500 8:dab8161ac8fc
501 9:3c77083deb4a
502 10:429fcd26f52d
503 11:82ca6f06eccd
504 12:9f259202bbe7
505 13:b0a32c86eb31
506 15:857b178a7cf3
507 16:609d82a7ebae
508 17:228c06deef46
434
509
435 user adds irrelevant but consistent information (here: -g 2) to bisect state
510 user adds irrelevant but consistent information (here: -g 2) to bisect state
436
511
@@ -450,3 +525,8 b' user adds irrelevant but consistent info'
450 date: Thu Jan 01 00:00:11 1970 +0000
525 date: Thu Jan 01 00:00:11 1970 +0000
451 summary: 11
526 summary: 11
452
527
528 $ hg log -q -r 'bisect(range)'
529 8:dab8161ac8fc
530 11:82ca6f06eccd
531 12:9f259202bbe7
532 13:b0a32c86eb31
General Comments 0
You need to be logged in to leave comments. Login now