sorin
sorin

Reputation: 170340

How do I convert a mercurial fork into a branch of its parent?

I am trying to convert a big amount of mercurial forks into branches and I am looking for a way to do this.

Is there a script that can do this?

Upvotes: 2

Views: 65

Answers (1)

ryanmce
ryanmce

Reputation: 436

I don't know of a script to do this automatically, but what I would do is this:

  • cd /path/to/fork
  • hg bookmark name-of-fork
  • cd /path/to/parent
  • hg pull /path/to/fork

Repeat this for all forks, and it will give you each fork with a bookmark on top. Then you can move between the branches in your parent repository with hg update bookmark-name, and you can remove all the forks to save disk space by reducing the shared information stored in each separate fork.

You could also use mercurial's branch functionality, but this would require rewriting all commits, and is much more trouble than it's worth (I think the value is mostly negative, actually).

Upvotes: 1

Related Questions