0

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?

Taryn East
  • 27,486
  • 9
  • 86
  • 108
Ozzy
  • 95
  • 3
  • 9

2 Answers2

1

I would recommend using hg graft, which copies changes from one branch to another and unlike hg 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:

hg update dest-branch

Then, use graft to copy the revisions you want from the original branch, e.g.:

hg graft -r start..end

where start is the first revision you want to graft from the source branch and end 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.

Reimer Behrends
  • 8,600
  • 15
  • 19
-1

The magic word is RTFM - hg help rebase

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • I try this but it does not work, It doesn't know this command. Is there any other solution? Thank, – Ozzy Jul 25 '14 at 08:13