gpt4 book ai didi

mercurial - 如何自动化 hg bisect --extend 以跟随共同祖先?

转载 作者:行者123 更新时间:2023-12-05 00:00:18 24 4
gpt4 key购买 nike

通常,在 hg bisect -c "my command" 的末尾我收到通知说我应该跑 hg bisect --extend <ancestor_cset>继续我的二等分更深。

我正在使用 mercurial 2.1.2。在 mercurial 2.1 之前,我的消息是使用 hg update 而不是 hg bisect --extend

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

有没有办法让 --extend 部分自动化并进行二等分,直到找到罪魁祸首 cset?

最佳答案

Bisect 不会超出变更集的初始范围。因此,如果您最初将变更集 10 设置为好而将变更集 20 设置为坏,并且在几次迭代后发现 cs 12 不好但与 cs 5 merge ,则 bisect 将停止。 --extend然后用于扩展初始 10-20 之外的范围。如果您想搜索整个范围,请将 cs 0 设置为好,tip 为坏,您永远不需要使用扩展。

考虑以下历史。变更集 4 引入了一个“错误”。

@  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 个变更集为第一个坏变更集,但它是一个 merge ,并建议将搜索扩展到变更集 2(共同祖先):
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 设置为好并将提示设置为坏,它会在没有扩展的情况下找到正确的变更集:
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

关于mercurial - 如何自动化 hg bisect --extend 以跟随共同祖先?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10456420/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com