使用 SharpSvn 检索日期范围内的日志条目
我正在使用 SharpSvn 与我的 svn 存储库进行交互通过 C# 代码。 我正在使用此代码来检索 svn 日志条目:
Collection<SvnLogEventArgs> logitems;
var uri = new Uri("http://myserver/svn/foo/bar.txt");
client.GetLog(uri, out logitems);
foreach (var logentry in logitems)
{
string author = logentry.Author;
string message = logentry.LogMessage;
DateTime checkindate = logentry.Time;
}
这效果很好,但现在我想按修订日期限制返回的日志条目。 这可以通过 svn 命令行来完成,比如
svn log "http://myserver/svn/foo/bar.txt" --revision {2008-01-01}:{2008-12-31}
我似乎无法弄清楚 SharpSvn 中的并行功能。 有人能指出我正确的方向吗?
I'm using SharpSvn to interact with my svn repository via C# code. I am using this code to retrieve svn log entries:
Collection<SvnLogEventArgs> logitems;
var uri = new Uri("http://myserver/svn/foo/bar.txt");
client.GetLog(uri, out logitems);
foreach (var logentry in logitems)
{
string author = logentry.Author;
string message = logentry.LogMessage;
DateTime checkindate = logentry.Time;
}
This works well, but now I want to restrict the returned log entries by revision date. This is something that can be done via the svn command line with something like
svn log "http://myserver/svn/foo/bar.txt" --revision {2008-01-01}:{2008-12-31}
I can't seem to figure out a parallel capability within SharpSvn. Can someone point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以这样尝试:
You can try it like this:
我认为您可以使用带有
SharpSvn.SvnLogArgs
参数的GetLog
函数之一来完成此操作。该类具有
Start
/End
,它们是SharpSvn.SvnRevision
对象,看起来好像它们需要“时间”范围。我只做了一点点,但这就是你可以开始寻找的地方。
I think you might be able to do it using one of the
GetLog
function that takes aSharpSvn.SvnLogArgs
parameter.That class has
Start
/End
that areSharpSvn.SvnRevision
objects which look like they can take a "time" parameter.I've only done a little bit with it, but that would be where you could start looking.