使用SharpSvn检索日期范围内的日志条目 [英] Using SharpSvn to retrieve log entries within a date range

查看:95
本文介绍了使用SharpSvn检索日期范围内的日志条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SharpSvn 与之交互我的SVN储存库通过C#代码.我正在使用此代码来检索svn日志条目:

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;
}

这很好,但是现在我想按修订日期限制返回的日志条目.这可以通过svn命令行完成,例如

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}

我似乎无法弄清楚SharpSvn中的并行功能.有人可以指出我正确的方向吗?

I can't seem to figure out a parallel capability within SharpSvn. Can someone point me in the right direction?

推荐答案

您可以这样尝试:

DateTime startDateTime = // ...;
DateTime endDateTime = // ...;
SvnRevisionRange range = new SvnRevisionRange(new SvnRevision(startDateTime), new SvnRevision(endDateTime));
client.GetLog(uri, new SvnLogArgs(range), out logitems);

这篇关于使用SharpSvn检索日期范围内的日志条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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