I am currently using Mercurial for sub-version control in my project. Now I am suppose to work on a new branch 2.7 but I confuse to work with branch 2.6, I have developed the new feature which the feature on 2.7 but I build on 2.6. And now I want to move this feature to branch 2.7 properly but I don't know how can I move it properly. Is there any way?
Move work to another branch Mercurial
108 Views Asked by Ozzy At
2
I would recommend using
hg graft
, which copies changes from one branch to another and unlikehg rebase
is not destructive (relevant if you're doing this for the first time and may be making mistakes or if you need the feature to be present on both branches).To copy changes to a branch
dest-branch
, do the following. First update to the branch you want to copy the changes to:Then, use graft to copy the revisions you want from the original branch, e.g.:
where
start
is the first revision you want to graft from the source branch andend
is the last revision.You may encounter conflicts if they can't be merged cleanly, which you have to resolve them (as you'd do in a merge), then use
hg graft --continue
to graft the remaining revisions.