Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete file history with bazaar

Someone committed all binaries to our bazaar trunk, and I want to get rid of it. `bzr del file' only deletes the file from the current revision, but not the history of the file.

Is there a way we can remove the file history so that we don't all have to download hundreds of MBs of data?

like image 922
Hans Avatar asked Feb 14 '10 18:02

Hans


1 Answers

There is 2 ways. But you need to be ready that you will re-create the part (or even full) of your branch history, so your current (local) branches will become incompatible with new branch after deleting the file.

1) Manual way. You can create a copy of your branch to revision just before big files have added. Then you need semi-manually re-commit your further revisions and exclude big files. Use replay command from bzr-rewrite plugin (former bzr-rebase) to replay those revisions where no changes to big files present. And use merge -cN for revisions where changes to big files are present, manually delete these files and commit. Thus you will keep most of your history intact and will keep unique file ids for other files of your branch.

2) Use bzr-fastimport plugin to export your history as fast-import stream with bzr fast-export command. Then filter out big files with bzr fast-import-filter -x FILE command. And in the end re-create new branch without big files with bzr fast-import command. This method w3ill destroy all your history and all your files will get new file ids, so your new branch will be totally incompatible with old branch.

In any case, if you have shared repository with big files history inside you need to create new empty shared repository and put your new filtered branch there.

like image 63
bialix Avatar answered Sep 30 '22 13:09

bialix