本文介绍了如何自动化hg bisect-扩展以跟随共同的祖先?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,在hg bisect -c "my command"的结尾,我会说我应该运行hg bisect --extend <ancestor_cset>来继续进行更深的对分.

Usually, at the end of a hg bisect -c "my command" I get note saying I should run hg bisect --extend <ancestor_cset> to continue my bisection deeper.

我正在使用水银2.1.2.在Mercurial 2.1之前,我的信息是使用hg update而不是hg bisect --extend

I am using mercurial 2.1.2. Before mercurial 2.1, I the message was to use hg update instead of hg bisect --extend

当罪魁祸首cset深度达到10个级别时,这真的很烦人,因此我必须手动执行此命令10次hg bisect --extend <ancestor_cset> && hg bisect -c "my command".

It becomes really annoying went the culprit cset is like 10 levels deep so I have to manually do this command 10 times hg bisect --extend <ancestor_cset> && hg bisect -c "my command".

有没有一种方法可以使--extend部分自动化并随身携带,直到找到罪魁祸首?

Is there a way to just automate the --extend part and carry one with bisection until the culprit cset is found?

推荐答案

Bisect不会超出变更集的初始范围.因此,如果最初将变更集10设置为好,将changset 20设置为坏,并且经过几次迭代,发现cs 12不好但与cs 5合并,则等分线将停止.然后使用--extend将范围扩展到最初的10-20.如果要搜索整个范围,则将cs 0设置为好,将tip设置为坏,并且您永远不需要使用extend.

Bisect won't go outside the initial range of changesets. So if you initially set changeset 10 as good and changset 20 as bad, and after a few iterations cs 12 is found bad but is a merge with cs 5, bisect will stop. --extend is then used to expand the range outside the initial 10-20. If you want to search the entire range, set cs 0 as good and tip as bad and you should never need to use extend.

请考虑以下历史记录.变更集4引入了一个错误".

Consider the following history. Changeset 4 introduces a "bug".

@  12:8ae1fff407c8:bad6
|
o  11:27edd4ba0a78:bad5
|
o    10:312ba3d6eb29:bad4
|\
| o  9:68ae20ea0c02:good33
| |
| o  8:916e977fa594:good32
| |
| o  7:b9d00094223f:good31
| |
o |  6:a7cab1800465:bad3
| |
o |  5:a84e45045a29:bad2
| |
o |  4:d0a381a67072:bad1
| |
o |  3:54349a6276cc:good4
|/
o  2:4588e394e325:good3
|
o  1:de79725cb39a:good2
|
o  0:2641cc78ce7a:good1

现在,如果我将变更集7标记为好,并将小费标记为坏,则将10标记为第一个不良变更集,但这是一个合并,建议将搜索范围扩展到变更集2(共同祖先):

Now if I mark changeset 7 as good and tip as bad, then 10 as found as the first bad changeset, but it is a merge and suggests extending the search to changeset 2 (the common ancestor):

C:\data>hg bisect -r
C:\data>hg bisect -g 7
C:\data>hg bisect -b tip
Testing changeset 9:68ae20ea0c02 (5 changesets remaining, ~2 tests)
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

C:\data>hg bisect -c check.bat
Changeset 9:68ae20ea0c02: good
Changeset 10:312ba3d6eb29: bad
The first bad revision is:
changeset:   10:312ba3d6eb29
parent:      9:68ae20ea0c02
parent:      6:a7cab1800465
summary:     bad4

Not all ancestors of this changeset have been checked.
Use bisect --extend to continue the bisection from
the common ancestor, 4588e394e325.

但是,如果我将变更集0设置为好,而将提示集设置为坏,它会找到正确的变更集而无需扩展:

But if I set changeset 0 as good and tip as bad, it finds the right changeset without extend:

C:\data>hg bisect -g 0
C:\data>hg bisect -b tip
Testing changeset 6:a7cab1800465 (12 changesets remaining, ~3 tests)
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

C:\data>hg bisect -c check.bat
Changeset 6:a7cab1800465: bad
Changeset 3:54349a6276cc: good
Changeset 4:d0a381a67072: bad
The first bad revision is:
changeset:   4:d0a381a67072
summary:     bad1

这篇关于如何自动化hg bisect-扩展以跟随共同的祖先?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 19:35