问题描述
以下问题变得越来越普遍:
The following issue is becoming increasing common:
- 有几位开发人员正在处理一个包含新文件(通常是图像)的项目
- 每个人都说一切都已签入,我们冻结了开发.我们不知道,有些图像没有被签入.用户没有注意到丢失的文件,因为它们是新的,而不是签出的,所以 svn 看起来不错
- 代码已编译和部署(抱歉,没有 QA 团队)
- 第二天客户告诉我们丢失的图片
- 首席技术官向我们宣读了暴动行为
注意:图像路径既在代码中又在数据库中,因此获取所有使用过的图像的完整列表并不容易.
Note: The image paths are both in code and in databases so it's not easy to get a full list of all used images.
我希望写一个小的C#程序供大家在部署前运行.我想找出项目目录中的哪些文件(或者递归的 subdir.s 之一)没有被添加到 subversion 中.理想情况下,我还想排除主动添加到忽略列表中的项目.
My hope is to write a small C# program for everyone to run before deployment. I want to find out which files in the project directory (or one of it's subdir.s, recursively) have not been added to subversion. Ideally, I'd also like to exclude items which were actively added to the ignore list.
我们在 Windows 主机和客户端上使用 TortoiseSVN.
We're using TortoiseSVN with Windows host and clients.
如何以编程方式发现未添加的文件?
到目前为止我能找到的最接近的东西是 this 说使用 svn status |grep -e ^?
但这看起来像一个 Unix 命令.
The closest thing I've been able to find so far is this saying to use svn status | grep -e ^?
but this looks like a Unix command.
推荐答案
你可以使用 SharpSvn 来写一些东西喜欢:
You could use SharpSvn for this, and write something like:
SvnClient client = GetClient();
client.Status(workingCopyPath, (o, e) =>
{
if(e.LocalContentStatus == SvnStatus.NotVersioned)
{
Console.WriteLine("Not versioned: " + e.FullPath);
}
});
这也将尊重您的忽略文件和 svn:ignore
属性.
this will also respect your ignore file and svn:ignore
properties.
这篇关于查找未添加到 subversion 的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!