简体   繁体   中英

How can I force hg merge to be interactive?

I am running an automated hg merge under CruiseControl.NET as part of an MSBuild job. For some reason the merge runs in non-interactive mode even though I have not specified -y in the command. This is causing unexpected results since it takes the first option when prompted about a conflict, I'd rather it just times out and fails so we know we need to look at it manually.

So two questons:

1) Why is it running non-iteractively when I haven't given it a -y ?
2) Is there a way to force the hg merge to be interactive so the job will timeout and fail?

Based on this answer on another question , it looks like Mercurial auto-detects if it is running under a TTY or is headless, thus doesn't prompt you. You could override this by supplying the ui.interactive config option:

hg --config ui.interactive=yes

I think better idea is to use hg merge --tool internal:merge . Mercurial will try to make automatic merge but will fail if there are any conflicts. There are other options possible here.

I am using it daily after automatic pull from external ClearCase repository and it works great. If there are any conflicts than my CI job just fails imediatelly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM