svn:ignore 没有按预期工作

发布于 2024-11-14 05:45:33 字数 1507 浏览 3 评论 0原文

我正在尝试为我遇到的另一个问题整理一个测试用例,为此我想用 svn:ignore 中的目录来模拟 svn 存储库。 设置该值后,该值中指定的目录将从版本控制中排除?正确的?

下面概述了我所做的事情。以及我得到的结果。我有点困惑,希望有人能帮助我。

[/tmp]$svn --version
svn, version 1.6.15 (r1038135)
  compiled Nov 29 2010, 16:11:54

[/tmp]$mkdir svnadmin
[/tmp]$cd svnadmin/
[/tmp/svnadmin]$svnadmin create ignoretest
[/tmp/svnadmin]$mkdir ../client
[/tmp/svnadmin]$cd ../client
[/tmp/client]$svn co file:///tmp/svnadmin/ignoretest
Checked out revision 0.
[/tmp/client]$cd ignoretest/
[/tmp/client/ignoretest]$svn propset svn:ignore private .
property 'svn:ignore' set on '.'
[/tmp/client/ignoretest]$svn propget svn:ignore
private

[/tmp/client/ignoretest]$svn ci -m "ignore set"
Sending        .

不确定我是否必须在这里进行提交,以我的理解 svn:ignore 是一个全局公认的参数,在这里设置它意味着它是为中央存储库设置的?

Committed revision 1.
[/tmp/client/ignoretest]$mkdir private
[/tmp/client/ignoretest]$echo 'secret' > private/file1.txt
[/tmp/client/ignoretest]$svn add *
A         private
A         private/file1.txt
[/tmp/client/ignoretest]$svn ci -m "something wrong?"
Adding         private
Adding         private/file1.txt
Transmitting file data .
Committed revision 2.

这确实给我提出了一个危险信号,

[/tmp/client/ignoretest]$mkdir ../../client2
[/tmp/client/ignoretest]$cd ../../client2
[/tmp/client2]$svn co file:///tmp/svnadmin/ignoretest
A    ignoretest/private
A    ignoretest/private/file1.txt

它确实已签入。

 U   ignoretest
Checked out revision 2.

I'm trying to pull together a testcase for another problem I have and for this I want to mimic a svn repository with a directory in svn:ignore.
When that value is set, the directory specified in the value is excluded from version controll? right?

below an outline of what I've done. And the results i got. I'm a kind of mystified, hopefully somebody here can help me.

[/tmp]$svn --version
svn, version 1.6.15 (r1038135)
  compiled Nov 29 2010, 16:11:54

[/tmp]$mkdir svnadmin
[/tmp]$cd svnadmin/
[/tmp/svnadmin]$svnadmin create ignoretest
[/tmp/svnadmin]$mkdir ../client
[/tmp/svnadmin]$cd ../client
[/tmp/client]$svn co file:///tmp/svnadmin/ignoretest
Checked out revision 0.
[/tmp/client]$cd ignoretest/
[/tmp/client/ignoretest]$svn propset svn:ignore private .
property 'svn:ignore' set on '.'
[/tmp/client/ignoretest]$svn propget svn:ignore
private

[/tmp/client/ignoretest]$svn ci -m "ignore set"
Sending        .

Not sure whether I have to do the commit here, in my understanding svn:ignore is a global recognized parameter setting it here means it is set for the central repository?

Committed revision 1.
[/tmp/client/ignoretest]$mkdir private
[/tmp/client/ignoretest]$echo 'secret' > private/file1.txt
[/tmp/client/ignoretest]$svn add *
A         private
A         private/file1.txt
[/tmp/client/ignoretest]$svn ci -m "something wrong?"
Adding         private
Adding         private/file1.txt
Transmitting file data .
Committed revision 2.

This does raise a red flag wih me

[/tmp/client/ignoretest]$mkdir ../../client2
[/tmp/client/ignoretest]$cd ../../client2
[/tmp/client2]$svn co file:///tmp/svnadmin/ignoretest
A    ignoretest/private
A    ignoretest/private/file1.txt

It is really checked in.

 U   ignoretest
Checked out revision 2.

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

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

发布评论

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

评论(2

蓝海似她心 2024-11-21 05:45:33

设置忽略属性实际上并不会阻止您将文件添加到存储库。当您运行“svn status”时,它只是阻止 svn 报告这些文件名。

如果您在设置忽略属性后运行“svn status”,您会注意到“private”没有显示。但是,没有什么可以阻止您显式添加和提交它,就像您使用“svn add *”所做的那样。

Setting the ignore property doesn't actually prevent you from adding files to the repository. It just stops svn from reporting those filenames when you run "svn status".

If you'd run "svn status" after setting the ignore property you'd notice that "private" wasn't displayed. However, there was nothing stopping you explicitly adding and committing it, as you did with "svn add *".

镜花水月 2024-11-21 05:45:33

我认为您对 svn add * 的使用会给您带来意想不到的结果。 shell 通常将 * 扩展到所有文件,并包含被忽略的文件。实际上,svn:ignore 被忽略了。我认为你最好使用 svn add –force 。

I think your use of svn add * is the one giving you unexpected results. The shell usually expands the * to all files and will include ignored ones. Effectively, the svn:ignore was, well, ignored. I think you are better off using svn add –force .

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