Reputation: 4470
I inherited a Mercurial repository that includes some directories with binary files.
All of the files in the aforementioned directories were removed from Mercurial a long time ago, and they will never be used again.
I've read that it is difficult to remove files permanently from Mercurial due to changeset hashes.
Is there any way to remove the data, either only from my local repository, or, preferably, from the bitbucket repository, too?
I don't care if the history of these files can remains in Mercurial, I just don't want to waste storage for them.
If I can't remove the files nicely from bitbucket, can I just delete the apropos .i files under .hg/store/data in my local repository? I'd retain the .i files in bitbucket. Would this cause any problems with my local repository, either by itself, or when pulling from or pushing to bitbucket? No one will ever clone from my local repository.
Thanks.
Upvotes: 0
Views: 481
Reputation: 95512
You can't really remove the data, but you can convert and filter a repository with the Convert extension. In your case, convert from Mercurial to Mercurial. See the --filemap option.
I don't think that counts as removing the data, because you end up with a new repository and new changeset ids. But you do end up with a new repository that excludes whatever you told it to exclude.
If you're the only developer, it seems safe to me to replace the existing bitbucket repository with your new one. But I'd test that on a scratch repository, myself. If you're not the only developer, take some time to plan the conversion. (And make sure it's worth the trouble. It's usually not--disk is cheap.)
Upvotes: 3