views:

112

answers:

1

Patch file is made with TopirtiseSVN -> Create Patch...

Attempting to import patch into the mercurial repository using hg import patchfile.

The problem I'm running into is that there seems to be problems with how hg looks for files referenced in the patch file:

unable to find 'gui/gui/RemoteFramework.cpp' for patching
2 out of 2 hunks FAILED -- saving rejects to file gui/gui/RemoteFramwork.cpp.rej

Seems to be an issue of where the patch was made in terms of directories and where it should be applied. Have tried playing with the --base option for hg import, but haven't gotten anywhere just yet.

Anyone have any tips?

+3  A: 

I suspect you need to do hg import --strip 0 patchfile since Subversion doesn't include any prefix on the file path. --base specifies where it should search for files, and --strip says how many (default 1) path elements to ignore on the beginning of the diff headers.

durin42
If you use the "patch" synonym to import, and the short form of --strip, it looks a lot like using plain old patch:hg patch -p0 patchfile
krupan