您可以创建一个新的存储库,并通过使用合适的脚本,使用先前历史记录的每次提交来填充它,但文件会自动从实际提交的内容修改为相同的文件,并替换选项卡。基本上,您的脚本需要检查初始文件集并获取提交详细信息,替换文件集中的任何选项卡,然后使用原始提交详细信息提交到新存储库。然后它会移动到下一个更改集,生成和应用补丁,再次过滤选项卡并提交等等。这里有一个关于做类似事情的博客。
您可以离线并自动执行此操作,并在商定的日期替换服务器上的存储库(当然保留一份副本),并使用修改后的存储库 - 只需记住告诉您的团队他们需要在下一次做任何工作之前拉取天。
我强烈建议实施预提交挂钩,以确保在有人尝试签入旧格式文件时不会受到污染。在开始该过程之前,它们可能值得在新存储库中到位。
更新
写完上述内容后,我终于想出了正确的搜索词,并找到了hg_clone,它应该完全符合您的需要,引用开场白:
# Usage: hg-clone.rb SOURCE-DIR DEST-DIR --target TARGET-REVISION --cutoff CUTOFF-REVISION --filter FILTER
#
# This program clones a mercurial repository to a new directory, changeset by changeset
# with the option of running a filter before each commit. The filter can be used for
# example to strip out secret data (such as code for unused platforms) from the code.
#
# --target TARGET-REVISION
# The revision that the DEST-DIR should be updated to. This revision, and all its parent revisions
# will be copied over to the dest dir. If no TARGET-REVISION is specified, the latest revision in
# the repositiory will be used.
#
# --cutoff CUTOFF-REVISION
# If specified, this should be a short revision number that acts as a cutoff for synching. If you
# specify 100 for instance, no revisions before 100 will be brought over to DEST-DIR. Revisions
# that have parents earlier than revision 100 will be reparented to have 100 as their revision.
#
# --filter FILTER
# Specifies a program that should be run in the DEST-DIR before committing each revision.