Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems while applying an svn patch to a mercurial repository

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

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

There seem 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

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

Anyone have any tips?

like image 236
mindless.panda Avatar asked Mar 09 '10 03:03

mindless.panda


1 Answers

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.

like image 105
durin42 Avatar answered Sep 23 '22 08:09

durin42