SvnClient.GetStatus(路径,参数,状态)为版本化文件返回0? [英] SvnClient.GetStatus(path, args, statuses) returning 0 for versioned file?

查看:252
本文介绍了SvnClient.GetStatus(路径,参数,状态)为版本化文件返回0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用SharpSVN编写了一个简单的C#应用​​程序,以在尝试添加之前查询文件的状态.为此,我在各个地方看到的示例涉及调用SvnClient的GetStatus方法,将完整路径和out参数传递给SvnStatusEventArgs的集合.

我的理解是,对于文件,GetStatus应该返回一个SvnStatusEventArgs集合,该集合的计数恰好为1,状态为NotVersioned,Missing,Normal等.

在我的应用程序中,对源控制下的文件的GetStatus调用返回了 zero 的Collection计数.

        SvnClient foo = new SvnClient();
        Collection<SvnStatusEventArgs> statuses;
        foo.GetStatus("C:\\Temp\\svnu\\Program.cs", new SvnStatusArgs {Depth = SvnDepth.Empty}, out statuses);

当我期望statuss [0] .LocalContentStatus值为Normal时为1时,statuses.Count的值为零.这个期望不正确吗?对于在源代码管理中引用文件 not 的路径的调用,该调用的工作状态为[0].LocalContentStatus值为NotVersioned.

该路径已被验证为工作副本,并且文件Program.cs实际上已经在Subversion中列出.我正在运行SharpSVN版本1.7005.2163.13448和VS2010.

在此先感谢您消除我明显的困惑.

编辑:更多信息:修改但不提交Program.cs之后,该相同代码段现在返回一个本地状态值为已修改"的单个状态值.提交文件后,将返回原始行为(没有返回状态值).

解决方案

根据Bert Huijben的反馈延迟发布答案的道歉.为了所有人的利益,我将答案发布在这里仅供参考.

实际上,修改原始的GetStatus调用以设置SvnStatusArgs对象的RetrieveAllEntries属性确实解决了此问题,并导致文件的本地(但无趣的:))副本的返回状态计数为1,根据需要将.LocalContentStatus设置为正常".

foo.GetStatus("C:\\Temp\\svnu\\Program.cs", new SvnStatusArgs {Depth = SvnDepth.Empty,
                                                               RetrieveAllEntries = true}, out statuses);

非常感谢.

I have written a simple C# app using SharpSVN to query the status of a file prior to attempting an add. The examples I've seen in various places for this very purpose involve calling the GetStatus method of the SvnClient, passing in the full path and an out parameter to a collection of SvnStatusEventArgs.

My understanding is that, for a file, GetStatus should return with an SvnStatusEventArgs collection having a count of exactly one, with a status among NotVersioned, Missing, Normal, and so on.

In my application, my call to GetStatus to a file under source control returns a Collection count of zero.

        SvnClient foo = new SvnClient();
        Collection<SvnStatusEventArgs> statuses;
        foo.GetStatus("C:\\Temp\\svnu\\Program.cs", new SvnStatusArgs {Depth = SvnDepth.Empty}, out statuses);

The value of statuses.Count is zero, when I am expecting 1 with a statuses[0].LocalContentStatus value of Normal. Is this expectation incorrect? For a call to a path referencing a file not in source control, the call works with a status[0].LocalContentStatus value of NotVersioned.

The path is verified to be a working copy, and the file Program.cs is, in fact, enlisted in Subversion. I'm running SharpSVN version 1.7005.2163.13448 and VS2010.

Many thanks in advance for clearing up my obvious confusion.

EDIT Some more info: After modifying, but not committing, Program.cs, this same code snippet now returns a single status value with LocalContentStatus of "Modified." After committing the file, the original behavior (no returned status value) returned.

解决方案

Apologies for the delay in getting the answer posted based on Bert Huijben's feedback. I'm posting the answer here just FYI for everyone's benefit.

Modifying the original GetStatus call to set the RetrieveAllEntries property of the SvnStatusArgs object did, in fact, solve this problem, and causes local (but uninteresting :) ) copies of files to have a return status count of 1, with a .LocalContentStatus of "Normal," as desired.

foo.GetStatus("C:\\Temp\\svnu\\Program.cs", new SvnStatusArgs {Depth = SvnDepth.Empty,
                                                               RetrieveAllEntries = true}, out statuses);

Many thanks.

这篇关于SvnClient.GetStatus(路径,参数,状态)为版本化文件返回0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆