清理 HG 存储库

Cleaning up an HG repo

目标:创建一个没有不必要文件的新存储库,占用 1.27 GB

解决方法:使用hg转换排除文件

问题:文件没有被排除

Filemap.txt内容:

exclude "feturehub/wp-content/uploads/backupbuddy_backups"
exclude "feturehub/wp-content/uploads/edd/2015"

命令

hg convert --filemap filemap.txt featurehub featurehubclean

正在 运行 来自 featurehub (src) 的父文件夹,src 还包含 filemap.txt

我得到的是一个只有 .hg 文件夹的文件夹,其中包含我要排除的 edd 文件夹(如果排除了 edd 或其 2015 子文件夹,2015 是唯一的东西edd文件夹)。

编辑: 删除了 filemap.txt 中的第三行,因为它不影响结果,但确实会造成混淆。

编辑2:

// fe is my source root, no there's no hg repo here, and each folder IS 
// a project with an hg repo, featurehub is one such project/repo

AndrijaMBA:fe ajambrovic$ ls | grep file
filemap.txt

AndrijaMBA:fe ajambrovic$ hg convert --filemap filemap.txt featurehub featurehubclean

initializing destination featurehubclean repository
scanning source...
sorting...
converting...
.....

运行执行命令后,新的存储库 featurehubclean 包含 edd 文件夹(及其子文件夹)。

好的,问题很简单 - 路径。而不是:

exclude "feturehub/wp-content/uploads/backupbuddy_backups"
exclude "feturehub/wp-content/uploads/edd/2015"

我应该用

exclude "wp-content/uploads/backupbuddy_backups"
exclude "wp-content/uploads/edd/2015"

此处的示例:https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html 显示使用(在本例中)"featurehub",即使扩展文档指出:

All paths should be specified as relative paths rooted in the converted directory. Unix path syntax should be used, regardless of OS.