merge
is the way to get changes from one branch into another. I know you merged default
into feature, but now you go the other way. Here's an example where numbered changesets come from other people and lettered changesets comes from you:
Before you do anything you clone and have this:
[1]---[2]---[3]---[4] (default branch)
then you create your branch named 'feature' and do two commits on it, yielding:
[1]---[2]---[3]---[4] (default branch)
\
[A]---[B] ('feature' branch)
then you hg pull
to get changes to default since you diverged down in your local repository:
[1]---[2]---[3]---[4]---[5]---[6] (default branch)
\
[A]---[B] ('feature' branch)
now you want their changes (5 and 6) integrated into your branch so you do:
hg checkout feature # make sure you're looking at the he head of your branch
hg merge default # merge default into your branch
which yields:
[1]---[2]---[3]---[4]---[5]---[6] (default branch)
\ \
[A]---[B]---[C] ('feature' branch)
If I'm understanding correctly, you've already done all that, so now you just need to bring your branch, including the new merge commit, C, into default, which again is done via a merge:
hg checkout default # hop back to default, files look like [6] and [A] and [B] are missing
hg merge feature # merge feature into default brining [A] and [B] in
that yields:
[1]---[2]---[3]---[4]---[5]---[6]---[7] (default branch)
\ \ /
[A]---[B]---[C] ('feature' branch)
That looks like a lot of work drawn out that way, but in practice it's usually just:
hg branch feature
....work....
hg commit
hg pull
hg merge default
hg checkout default
hg merge feature
and if the pull
didn't bring down any new work from other you can skip the merging of default into yours.
That does create two new merge changesets. They're easily hidden on hg log
if you find them unhelpful (some people love having a record of which direction each merge went), but if you want to avoid them entirely you can use bookmarks
(very similar to git branches) instead of "named branches" for your features -- then you'll avoid a merge changeset when coming back since it would be the spiritual equivalent of what git calls a "fast forward" merge.