Mercurial 文件映射排除包括...它不按照文档所说的那样做吗?
从颠覆转换后,我借此机会清理了存储库,并将其分成三个大部分独立的项目。但是...我有一个文件映射,上面写着“
exclude bot
include bot/aobiosbot.py
哪个应该包含除“bot”子目录之外的所有内容,但仍包含该目录中的“aobiosbot.py”文件。问题是,转换后的存储库是空的(我使用“hg clone”进行测试)。如果我添加一个“包含”。作为第一行,我得到了除了“bot”目录之外的所有内容...包括“bot/aobiosbot.py”。但我告诉它包含该文件。
(确实,文件映射的文档很糟糕。必须准确地指定排除/包含选项。我发现我倾向于同意 Joel 的规范......至少在这里。Who'd'a thunk ...)
Converting from subversion, I take the opportunity to clean up the repo, and split it in three mostly independent projects. But... I have a filemap that says
exclude bot
include bot/aobiosbot.py
Which should include everything, except the "bot" subdirectory, but still include the "aobiosbot.py" file in that directory. The trouble is, the converted repo is empty (I test with an "hg clone"). If I add an "include ." as line 1, I get everything but the "bot" dir... including "bot/aobiosbot.py". But I told it to include that file.
(Really, the docs for filemap are bad. Exclude/include options have to be specified exactly. I find I tend to agree with Joel on specs... at least here. Who'd'a thunk...)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,我承认我无法弄清楚为什么你所拥有的不起作用,但我可以确认它不起作用。
但是,使用我的测试 src 存储库,如下所示:
和文件映射如下:
我最终得到以下结果:
您可以通过在存储库根目录中执行此操作来快速建立该文件映射:
我确定有一个更好的使用排除的方式,但没有阅读转换代码我找不到它。
Hrm, I'll admit to not being able to figure out why what you have isn't working, but I can confirm it's not.
However, with my test src repo like this:
and a filemap like this:
I end up with this:
You could bulld that filemap quickly by doing this in the repo root:
I'm sure there's a better way using exclude, but without reading the code for convert I can't find it.
我通过从开发仓库(文件 hgext/convert/filemap.py)中获取一些代码解决了这个问题。效果好多了。 :D
I've solved it by taking some code from the dev repo (file hgext/convert/filemap.py). Works lots better. :D