简体   繁体   中英

Mercurial, detect merge conflicts

I want to create a bash script that periodically merges my default branch into all active branches. When a merge conflict occurs, the script should skip the branch and rollback any changes.

To achieve this I figure I need to detect if a conflict occurs. Is there a way to detect conflicts before merging? Something like a hg detect-conflicts ?

You can use hg merge --tool internal:merge to attempt a merge using Mercurials internal merging tools (so no vimdiff etc.) Then use hg resolve --list to see if you have any conflicts.

$ hg resolve --list

U conflicted.file

If this is the case, you can use hg update -C . to revert back to the revision before the merge.

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