创建SvnRevisionRange时,range.StartRevision.Time会在提供的日期时间内减少5小时。因此,在获取日志时,它不会检索正确的日志,因为时间未正确传递。有人可以帮忙吗? SharpSvn版本在.net 3.5中为1.6017.1920.11722
DateTime startDateTime = dtStart.DateTime.Date;
DateTime endDateTime = dtEnd.DateTime.Date.AddHours(23).AddMinutes(59).AddSeconds(59);
SvnRevisionRange range = new SvnRevisionRange(new SvnRevision(startDateTime), new SvnRevision(endDateTime));
答案 0 :(得分:1)
只是为了澄清这个问题 - 你说SvnRevisionRange对象的时间属性与最初传入的值不一致?
如果是这样,此测试将失败:
DateTime startDateTime = DateTime.UtcNow.AddDays(-1);
DateTime endDateTime = DateTime.UtcNow;
SvnRevisionRange range = new SvnRevisionRange(new SvnRevision(startDateTime), new SvnRevision(endDateTime));
Assert.AreEqual(startDateTime, range.StartRevision.Time, "The start times are not equal");
Assert.AreEqual(endDateTime, range.EndRevision.Time, "The end times are not equal");
将上面的代码作为单元测试运行并发布结果......