hgignore glob的工作方式与hgstatus glob不同

2024-04-27 00:47:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我的文件夹设置如下:

  • 项目/最新\u kml/文件.kml你知道吗
  • 项目/.hgignore
  • 项目/.hg/。。。你知道吗

我的.hginore文件如下所示:

syntax: glob *.kml *.kmz **nohup.out log/**

经过一番搜索,我发现我应该用“**.kml” 我不明白的是为什么*.kml忽略了.kml文件。如果我将一个新的.kml文件添加到最新的\u kml文件夹中,当我运行addremove时,它不会被添加,也不会以hg状态出现。你知道吗

如果删除*.kml行,hg status将显示新的.kml文件。你知道吗

令人困惑的部分:如果我从.hgignore中删除'*.kml'行并运行hg status'glob:*.kml',它将显示添加到project/latest\u kml/中的新kml文件。如果我改用hg status'glob:*.kml',它什么也不显示。你知道吗

这种行为的原因是什么?你知道吗


Tags: 文件项目文件夹logstatusouthgkml
1条回答
网友
1楼 · 发布于 2024-04-27 00:47:41

hg help patterns清楚地说明

Globs are rooted at the current directory; a glob such as "*.c" will only match files in the current directory ending with ".c".

The supported glob syntax extensions are "**" to match any string across path separators

...

 glob:*.c       any name ending in ".c" in the current directory
 *.c            any name ending in ".c" in the current directory
 **.c           any name ending in ".c" in any subdirectory of the
                current directory including itself.

相关问题 更多 >