I want to apply the patch in Mercurial:
hg import patch_name.patch
But if I get an error abort: patch failed to apply, Mercurial creates the files *.rej.
abort: patch failed to apply
*.rej
Is there a way to show kdiff or vim-diif to resolve the conflict.
There is no way to do this. The recommended approach is to open the file and the .rej file and manually combine in the rejected hunks.
, hg . , hg import script, , , ? - :
hg import
#!/bin/sh # run the script by typing `hgimp patch_name.patch` # $1 below will contain patch_name.patch hg import $1 # if the return code is not equal to 0, run vimdiff or whatever if [ ! "$?" -eq '0' ]; then # run your diff/cleanup commands here fi