本文整理汇总了C#中Tp.SourceControl.VersionControlSystem.RevisionId类的典型用法代码示例。如果您正苦于以下问题:C# RevisionId类的具体用法?C# RevisionId怎么用?C# RevisionId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RevisionId类属于Tp.SourceControl.VersionControlSystem命名空间,在下文中一共展示了RevisionId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFromTillHead
public RevisionRange[] GetFromTillHead(RevisionId @from, int pageSize)
{
var currentRevision = from;
var lastRevision = long.Parse(Revisions.Last().Id.Value);
return GetFromTo(currentRevision, lastRevision, pageSize);
}
示例2: GetToRevision
private RevisionId GetToRevision(RevisionRange processedRevisionRange, RevisionId newToRevision)
{
if (RevisionComparer.Is(newToRevision).GreaterThan(processedRevisionRange.ToChangeset))
{
return newToRevision;
}
return processedRevisionRange.ToChangeset;
}
示例3: CheckRevision
public override void CheckRevision(RevisionId revision, PluginProfileErrorCollection errors)
{
GitRevisionId revisionId = revision;
if (revisionId.Time > GitRevisionId.UtcTimeMax)
{
_errorResolver.HandleConnectionError(new InvalidRevisionException(), errors);
}
}
示例4: GetRevisions
public RevisionInfo[] GetRevisions(RevisionId fromChangeset, RevisionId toChangeset)
{
var revisionInfos = GetChangesets(changeset => changeset.ChangesetId >= int.Parse(fromChangeset.Value) && changeset.ChangesetId <= int.Parse(toChangeset.Value))
.Select(changeset => changeset.ToRevisionInfo())
.ToArray();
return revisionInfos;
}
示例5: CheckRevision
public override void CheckRevision(RevisionId revision, PluginProfileErrorCollection errors)
{
TfsRevisionId revisionId = revision;
if (Int32.Parse(revisionId.Value) <= 0 || Int32.Parse(revisionId.Value) > Int32.MaxValue)
{
_errorResolver.HandleConnectionError(new InvalidRevisionException(), errors);
}
}
示例6: ConvertToRevision
private static long ConvertToRevision(RevisionId revision)
{
long revisionId;
if (!Int64.TryParse(revision.Value, out revisionId))
{
revisionId = 0;
}
return revisionId;
}
示例7: ShouldHandlePosixTime
public void ShouldHandlePosixTime()
{
var initialTime = DateTime.Today.AddHours(6);
TfsRevisionId revisionId = new RevisionId { Time = initialTime, Value = Guid.NewGuid().ToString() };
RevisionId revisionIdDto = revisionId;
TfsRevisionId restoredRevisionId = revisionIdDto;
restoredRevisionId.Time.Should(Be.EqualTo(initialTime));
}
示例8: GetFrom
private RevisionId GetFrom(RevisionId @from)
{
var startRevision = _revisionComparer.ConvertToRevisionId(_settings.StartRevision);
var missingRevisionsCheckInterval = @from.Time.Value.AddDays(-MissingRevisionsCheckInterval);
var toChangeset = startRevision.Time > missingRevisionsCheckInterval
? startRevision
: new RevisionId { Time = missingRevisionsCheckInterval };
return toChangeset;
}
示例9: GetRevisions
public RevisionInfo[] GetRevisions(RevisionId fromChangeset, RevisionId toChangeset)
{
var revisionInfos =
GetChangesets(VersionSpec.ParseSingleSpec((fromChangeset.Value).ToString(CultureInfo.InvariantCulture), null),
VersionSpec.ParseSingleSpec((toChangeset.Value).ToString(CultureInfo.InvariantCulture), null))
.Select(changeset => changeset.ToRevisionInfo())
.ToArray();
return revisionInfos;
}
示例10: GetFromRevision
private RevisionId GetFromRevision(RevisionRange processedRevisionRange, RevisionId newFromRevision)
{
if (RevisionComparer.Is(StartRevision).LessThan(newFromRevision))
newFromRevision = StartRevision;
if (RevisionComparer.Is(newFromRevision).LessThan(processedRevisionRange.FromChangeset))
{
return newFromRevision;
}
return processedRevisionRange.FromChangeset;
}
示例11: GetCommit
public RevCommit GetCommit(RevisionId id)
{
var revWalk = CreateRevWalker();
try
{
return revWalk.ParseCommit(ObjectId.FromString(id.Value));
}
finally
{
revWalk.Dispose();
}
}
示例12: Equals
public bool Equals(RevisionId other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
return Equals(other.Value, Value);
}
示例13: GetAfterTillHead
public IEnumerable<RevisionRange> GetAfterTillHead(RevisionId revisionId, int pageSize)
{
var revSpec = new RevSpec(revisionId.Value);
var command = new LogCommand().WithRevision(RevSpec.From(revSpec) && !new RevSpec(revisionId.Value));
var pages = _repository.Log(command)
.OrderBy(ch => ch.Timestamp)
.ToArray()
.Split(pageSize);
var result = pages.Select(page => new RevisionRange(page.First().ToRevisionId(), page.Last().ToRevisionId()));
return result;
}
示例14: GetFromAndBefore
public IEnumerable<RevisionRange> GetFromAndBefore(RevisionId fromRevision, RevisionId toRevision, int pageSize)
{
var command = new LogCommand();
var pages = _repository.Log(command)
.Where(ch => (ch.Timestamp >= fromRevision.Time.Value && ch.Timestamp <= toRevision.Time.Value))
.OrderBy(ch => ch.Timestamp)
.ToArray()
.Split(pageSize);
var result = pages.Select(page => new RevisionRange(page.First().ToRevisionId(), page.Last().ToRevisionId()));
return result;
}
示例15: GetDiff
public override DiffResult GetDiff(RevisionId changeset, string path)
{
var commit = _git.GetCommit(changeset);
var parent = _git.GetCommit(commit.GetParent(0).Id.Name);
try
{
return GetDiff(path, parent, commit);
}
catch (GitAPIException ex)
{
throw new VersionControlException(String.Format("Git exception: {0}", ex.Message));
}
}