Reputation: 42690
I receive a patches from a contributor. Apparently, he produces the patches in trunk. However, I would like to commit his changes to a new branch. May I know how I can do so through Tortoise-Hg?
Upvotes: 9
Views: 4489
Reputation: 750
The original branch from where the patch came from doesn't matter to hg import
unless you use the option --exact
. So, you should create the branch you want and apply the patch:
hg branch new_branch
hg import /tmp/patch.txt
Upvotes: 1
Reputation: 593
In TortoiseHg 2.7, update to the branch you want to apply the patch to (or create it if it doesn't exist). Choose Repository > Import and use Browse... to select an individual patch file, or Browse Directory... to import a folder of patches.
Upvotes: 3
Reputation: 62168
The directions found below assume you want the patches isolated on a named branch
.
Using the command-line, it is easy to apply patches to a new named branch. However if you want to do this using TortoiseHg only, you must create the named branch with an empty commit prior to applying the patches.
hg branch <branch name>
hg qimport --push <patch-file-1>
hg qimport --push <patch-file-2>
hg qfinish --applied
branch: default
"Open a new named branch
"OK
button.Commit
".Finish Applied
"The same process used for TortoiseHg v1.1.x will work. The process to create the named branch with an empty commit is slightly different, but the overall concept is the same.
Upvotes: 12