How to get mercurial to emit base revision of conflicted file as well as modified version?

前端 未结 4 1575
轮回少年
轮回少年 2021-01-13 19:58

I\'m trying to merge two branches together using mercurial and there are some conflicts. When working in Subversion, merge conflicts would result in the conflicted file bein

4条回答
  •  终归单人心
    2021-01-13 20:55

    How about setting a merge tool that just saves the files mercurial is creating for the merge tool to operate on?

    [ui]
    merge = copy
    
    [merge-tools]
    copy.executable = /path/to/mycopy.sh
    copy.args = $base $local $other $output
    

    And then in mycopy.sh just do something like:

    #!/bin/sh
    cp $1 $4.base
    cp $2 $4.mine
    cp $3 $4.theirs
    

    That should always succeed instantly and leave you with a .base a .mine and a .theirs for each file that conflicted. You can set that up once in your ~/.hgrc and be done with it.

提交回复
热议问题