Mercurial 文件映射排除包括...它不按照文档所说的那样做吗?

发布于 2024-08-17 02:45:54 字数 395 浏览 10 评论 0原文

从颠覆转换后,我借此机会清理了存储库,并将其分成三个大部分独立的项目。但是...我有一个文件映射,上面写着“

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

¢蛋碎的人ぎ生 2024-08-24 02:45:54

嗯,我承认我无法弄清楚为什么你所拥有的不起作用,但我可以确认它不起作用。

但是,使用我的测试 src 存储库,如下所示:

src
|-- bot
|   |-- aobiosbot.py
|   `-- excludeme
`-- dir1
    `-- includeme

和文件映射如下:

include dir1
include bot/aobiosbot.py

我最终得到以下结果:

dest
|-- bot
|   `-- aobiosbot.py
`-- dir1
    `-- includeme

您可以通过在存储库根目录中执行此操作来快速建立该文件映射:

for thefile in * .* ; do
     echo include $thefile >> ../filemap
done

确定有一个更好的使用排除的方式,但没有阅读转换代码我找不到它。

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:

src
|-- bot
|   |-- aobiosbot.py
|   `-- excludeme
`-- dir1
    `-- includeme

and a filemap like this:

include dir1
include bot/aobiosbot.py

I end up with this:

dest
|-- bot
|   `-- aobiosbot.py
`-- dir1
    `-- includeme

You could bulld that filemap quickly by doing this in the repo root:

for thefile in * .* ; do
     echo include $thefile >> ../filemap
done

I'm sure there's a better way using exclude, but without reading the code for convert I can't find it.

洋洋洒洒 2024-08-24 02:45:54

我通过从开发仓库(文件 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文