如何忽略 .svn 文件夹中的 dir-prop-base ?

发布于 2024-10-08 16:30:20 字数 504 浏览 1 评论 0原文

我读过几篇关于在 Mercurial 中忽略文件的文章,但我对这篇文章感到困惑。

我的存储库中有几个 .svn 文件(我使用 hg 进行本地提交,然后推送到 svn)。这些文件是:

Apps\.svn\dir-prop-base 
Apps\.svn\entries 

我的 .hgignore 中有几个忽略条目,但它们似乎都没有覆盖这两个文件。

syntax: glob
.svn/*
**/.svn/**.*
syntax: regexp
\.svn\\*

我正在尝试一些事情来看看哪一个能坚持下去。对我来说,看起来这些文件应该被忽略两次。奇怪的是 Apps\.svn\all-wcprops 被忽略了。显然我错过了一些东西。我正在通过使用 TortoiseHg 打开一个新的状态窗口来检查文件是否被忽略。我无法检测到它与 hg status 之间有任何区别。

I've read several posts here about ignoring files in Mercurial but I'm stumped on this one.

I have a couple of .svn files in my repository (I'm using hg for local commits, then pushing to svn). The files are:

Apps\.svn\dir-prop-base 
Apps\.svn\entries 

I've got several ignore entries in my .hgignore but none of them seem to be covering these two files.

syntax: glob
.svn/*
**/.svn/**.*
syntax: regexp
\.svn\\*

I'm trying a couple of things to see which sticks there. To me, it looks like those files should be ignored twice. The strange thing is that Apps\.svn\all-wcprops is being ignored. Clearly I'm missing something. I'm checking whether the files are ignored by opening a new status window using TortoiseHg. I can't detect any difference between that and hg status.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

旧情别恋 2024-10-15 16:30:20

奥本为我指明了正确的方向。他拒绝回答,所以这里是:

当您编辑忽略文件时,您想要忽略的文件不能处于“添加”状态(因为“添加”显然优先于“忽略”)。所以我的解决方案是执行 hg revert,编辑忽略文件,然后使用 hg status [directory] ​​-i 来查看目标目录中的哪些文件将被忽略。重复此操作,直到忽略所有正确的文件,然后使用 hg add

Oben pointed me in the right direction. He declined making an answer, so here it is:

The files that you want to ignore can't be in an Add state when you are editing the ignore file (since Add takes precedence over Ignore apparently). So my solution was to do hg revert, edit the ignore file, then use hg status [directory] -i to see which files in the target directory would be ignored. Repeat until all the correct files are ignored, then use hg add.

回心转意 2024-10-15 16:30:20
syntax: regexp
^.*\.svn/dir-prop-base$

对我有用。

syntax: regexp
^.*\.svn/dir-prop-base$

works for me.

雨巷深深 2024-10-15 16:30:20

以下简单的 .hgignore 可以很好地让我忽略所有 .svn 文件夹(在 Windows 上,hg 1.7):

syntax: glob
.svn

The following simple .hgignore works fine for me to ignore all .svn folders (on Windows, hg 1.7):

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