Arek
Arek

Reputation: 1336

Merging changesets to anonymous branch

I have a branch in HG repo (let it be default). I started an anonymous branch at some point, to make some tests (and added a feature, although I'm not sure yet what's the big adventage of having a feature, if using TortoiseHg). So far so good.

Now, the default branch got some bugfixes. I need them in my anonymous branch too.

What's the best way to merge or handle this scenario?

Upvotes: 1

Views: 239

Answers (4)

Sentient
Sentient

Reputation: 2263

I would just export the changesets from the default branch and import them into the anonymous branch.

Upvotes: 0

Stephen Rasku
Stephen Rasku

Reputation: 2682

You can just merge. As you commit after the merge, your anonymous branch will continue until you're ready to push.

Upvotes: 1

Lazy Badger
Lazy Badger

Reputation: 97355

If you want integrate only some changesets after point of divergence from mainline into anonymous branch head, you can (depending on tree)

  • rebase --keep
  • graft

as it happens with named branches also

Upvotes: 1

Steve Kaye
Steve Kaye

Reputation: 6262

To copy the changes from the main default branch to the anonymous branch you would merge the default branch into the anonymous branch.

The problem with this is that you'd lose the extra branch so you'd need to note the current head of the main default branch if you didn't want the anonymous branch's changes in the main branch. To do this, you could tag the head of the main default branch before the merge.

Another option would be to mark it with a bookmark before doing the merge.

Then, if you need to make further changes to the main branch before permenamtly merging the two branches you would update to the tag or bookmark first.

Upvotes: 2

Related Questions