1

When creating a SvnRevisionRange, range.StartRevision.Time decreases 5 hours to the date time provided. So when getting the log it doesn't retrieve the correct logs since the time is not passed correctly. Can anyone help? SharpSvn version is 1.6017.1920.11722 in .net 3.5

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));
Shak Ham
  • 1,209
  • 2
  • 9
  • 27

1 Answers1

1

Just to clarify the question-- you're saying that the time properties of the SvnRevisionRange object are inconsistent with the values originally passed in?

If so, this test would fail:

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");

Run the code above as a unit test and post the results...

  • Thanks watkinsmatthewp, that got me through the right direction. I was using dtStart.DateTime.Date (being dtStart a date time picker). When I tried DateTime.SpecifyKind(dtStart.DateTime.Date, DateTimeKind.Utc) worked fine. – Shak Ham Jun 24 '13 at 15:44