开发者

Mercurial permament delete?

I commit some 3rd party tools that i decided not to use afterwards and removed them from hg again.

开发者_如何学运维

Thing that i dislike - they are still kept in history. Normally this is a good thing of course, but for this particular case - that's just a waste of space.

What are options to intentionally mess around with hg repository history and weed it out?


If you don't mind having to switch to a new repository, your best bet would be to use the convert extension.

You can pass a filemap that excludes any files that you want to exclude and it will create a new repository for you, without any references to your files. Of course, this means having to clone a new working copy.

This means every working copy for the repository, so if there are a lot of working copies around, be prepared to do a lot of work.


Activate the mercurial queue extension and use "hg strip" to rewrite history. If you have any clone out there, push their changes and destroy them, do the "hg strip" and clone again.

If there are clones out there you can not control, all the bets are off. I would use the "convert" extension to rebuild the repository, do the "hg strip", and replace the old repository. Old clones will get an error when trying to push/pull, because the new repository has a different UUID, so the users will know they must destroy+clone again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜