Accidently I checked-in 5GB around of files to Mercurial. Our Build server started failing during cloning of repo. So we reverted the checked- in files by using Remove command. But .hg/store/data is still containing those files. And it's size is over 5GB. We have searched over internet and found few methods, like: hg convert. But hg convert is creating new repo which is not desired in our case. Also we cannot extend the Timeout period of our build server.
How could we remove the bad check-in completely without making it to store in .hg/store/data? Or How could we reduce the size of .hg/store/data?
Here's what you need to do: You need to strip those changesets.
Since your repository is hosted on Bitbucket, you do not have direct access to the files so you need to use what the website provides.
In your repository project, under settings, there is a section for stripping out changesets.
Note that this will also remove any changesets that were committed on top of the bad changeset. We will deal with this.
I will stress this:
Here are the steps
Important: If any developer on your team has anything pending locally, like changesets not yet having been pushed to bitbucket, but they have cloned the bad changeset from bitbucket, then you need to do more grafting, be sure you understand everything that needs to be done before attempting this.
In the local clone, first graft any and all changesets that were committed on top of the bad changeset onto the changeset directly preceeding it.
ie. if the history looks like this:
1---2---3---BAD---5---6---7
You want to graft 5-7 on top of 3 so that you afterwards have this history:
1---2---3---BAD---5---6---7
\
+--5---6---7
Then strip the bad changeset (and everything that follows it) by using this command:
hg strip BAD
`BAD` here is the number or hash of the bad changeset