Felipe Pessoto
Felipe Pessoto

Reputation: 6969

Using mercurial, can I push just one revision with all the content?(Push and Collapse)

I am writing a open source project, I did all the work at my machine and now I want to push the project do Codeplex.com, but I dont want to send all the old history.

Its possible to push all files in just one revision to Codeplex and continue with my history locally? Something like a Push And Collapse

Upvotes: 1

Views: 99

Answers (2)

Mark Tolonen
Mark Tolonen

Reputation: 178264

Check out the CollapseExtension.

Upvotes: 1

Alex Norcliffe
Alex Norcliffe

Reputation: 2489

No - a DVCS relies on the fact that you synchronise all history between members in the distribution set.

If you want to get rid of the history though, prior to pushing to Codeplex you can do the following:

  • Clone your local repository to a revision before the history you want "removed". We'll call the clone "Repository B".
  • Update repository A to the tip that you want to apply. Grab the changes, and copy the files to your cloned repository B. You can greate a bundle or patch, but for brevity here I'm just going with the quick and dirty :)
  • On repository B, commit a single changeset with all those changes.
  • From now on, repository B is your master. Push this to Codeplex.

As you can see, you can't have historical changeset data on one clone that partakes in a synchronisation with another, but before you've pushed to Codeplex, you can mush all those changes into a single commit - so long as you're happy to lose the history locally too.

An alternative is to use Mercurial Queues to "fold" history, but it needs to be done before you push to Codeplex - check out this wiki page for more information.

Upvotes: 2

Related Questions