本文整理匯總了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));
}
}