mercurial

Is it safe to remove bundles in strip-backup folders?


Recently I have rewrote a lot of history (Forgive me Father, for I have sinned). Our old repository had a lot of sensitive information as well as unnecessary merges (up to 20 anonymous branches running simultaneously and being merged back indiscriminately), so I have striped several commits, pruned dead branches, rebased / squashed commits, rolled back unnecessary merges, created bookmarks, etc.

We now have a clean repo. I have also run unitary tests along several revisions to make sure that I haven't broke anything important. Yesterday I've forked the old repo (for backup purposes) and pushed the clean repository upstream. We are a small team and synchronizing changes was not a problem, every developer in my team is already working with the new repo.

Anyway, my local repository now have a .hg/strip-backup folder of around 2 Gigabytes. From what I was able to understand, this folder contains backup bundles for every one of the destructive commands that I have run. I no longer need those.

My question is: Is it safe to remove the bundles inside .hg/strip-backup? Or will I corrupt my local repository if I delete those files?

Bonus question: Is there a built-in mercurial command to remove backups or should I just use rm .hg/strip-backup/*?


Solution

  • Yes, it is safe to remove the whole folder. The information contained in the folder is not relevant to the repo.

    As a bonus answer, your best option to clean-up the cache folders is to simply re-clone the repo. Doing so allows you to start fresh and all the temporary files will be left on the base repo. Replace the original repo with a cloned repo and you won't have to bother with this history of temporary files for a while.