• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# VersionControlSystem.RevisionId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Tp.SourceControl.VersionControlSystem.RevisionId的典型用法代码示例。如果您正苦于以下问题:C# RevisionId类的具体用法?C# RevisionId怎么用?C# RevisionId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RevisionId类属于Tp.SourceControl.VersionControlSystem命名空间,在下文中一共展示了RevisionId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:VersionControlSystemMock.cs


示例2: GetToRevision

		private RevisionId GetToRevision(RevisionRange processedRevisionRange, RevisionId newToRevision)
		{
			if (RevisionComparer.Is(newToRevision).GreaterThan(processedRevisionRange.ToChangeset))
			{
				return newToRevision;
			}
			return processedRevisionRange.ToChangeset;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:VersionControlSystemProcessorBase.cs


示例3: CheckRevision

		public override void CheckRevision(RevisionId revision, PluginProfileErrorCollection errors)
		{
			GitRevisionId revisionId = revision;
			if (revisionId.Time > GitRevisionId.UtcTimeMax)
			{
				_errorResolver.HandleConnectionError(new InvalidRevisionException(), errors);
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:GitVersionControlSystem.cs


示例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;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:TfsClient.cs


示例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);
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:TfsVersionControlSystem.cs


示例6: ConvertToRevision

		private static long ConvertToRevision(RevisionId revision)
		{
			long revisionId;
			if (!Int64.TryParse(revision.Value, out revisionId))
			{
				revisionId = 0;
			}
			return revisionId;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:9,代码来源:SvnRevisionId.cs


示例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));
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:10,代码来源:TfsRevisionIdSpecs.cs


示例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;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:10,代码来源:GitVersionControlSystem.cs


示例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;
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:10,代码来源:TfsClient.cs


示例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;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:11,代码来源:VersionControlSystemProcessorBase.cs


示例11: GetCommit

 public RevCommit GetCommit(RevisionId id)
 {
     var revWalk = CreateRevWalker();
     try
     {
         return revWalk.ParseCommit(ObjectId.FromString(id.Value));
     }
     finally
     {
         revWalk.Dispose();
     }
 }
开发者ID:FarReachJason,项目名称:Target-Process-Plugins,代码行数:12,代码来源:GitClient.cs


示例12: Equals

		public bool Equals(RevisionId other)
		{
			if (ReferenceEquals(null, other))
			{
				return false;
			}
			if (ReferenceEquals(this, other))
			{
				return true;
			}
			return Equals(other.Value, Value);
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:12,代码来源:RevisionId.cs


示例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;
        }
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:13,代码来源:MercurialClient.cs


示例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;
        }
开发者ID:MaxSuhinin,项目名称:Mercurial-Plugin,代码行数:13,代码来源:MercurialClient.cs


示例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));
            }
        }
开发者ID:FarReachJason,项目名称:Target-Process-Plugins,代码行数:14,代码来源:GitVersionControlSystem.cs


示例16: GetDiff

		public override DiffResult GetDiff(RevisionId changeset, string path)
		{
			var commit = _tfsClient.GetCommit(changeset);
			var parent = _tfsClient.GetParentCommit(commit);

			try
			{
				return GetDiff(path, parent, commit);
			}
			catch (Exception ex)
			{
				throw new VersionControlException($"TFS exception: {ex.Message}");
			}
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:14,代码来源:TfsVersionControlSystem.cs


示例17: GetFromAndBefore

        public IEnumerable<RevisionRange> GetFromAndBefore(RevisionId fromRevision, RevisionId toRevision, int pageSize)
        {
			var from = new RevSpec(fromRevision.Value);
			var to = new RevSpec(toRevision.Value);
	        var command = new LogCommand().WithRevision(RevSpec.Range(from, to));
            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;
        }
开发者ID:sbcfwebdev,项目名称:Target-Process-Plugins,代码行数:14,代码来源:MercurialClient.cs


示例18: GetDiff

        public override DiffResult GetDiff(RevisionId changeset, string path)
        {
            var commit = _mercurial.GetCommit(changeset);
            var parent = _mercurial.GetParentCommit(commit);

            try
            {
                return GetDiff(path, parent, commit);
            }
            catch (MercurialException ex)
            {
                throw new VersionControlException(String.Format("Mercurial exception: {0}", ex.Message));
            }
        }
开发者ID:TargetProcess,项目名称:Mercurial-Plugin,代码行数:14,代码来源:MercurialVersionControlSystem.cs


示例19: GetFromTo

		private static RevisionRange[] GetFromTo(RevisionId @from, long to, int pageSize)
		{
			var result = new List<RevisionRange>();
			while (long.Parse(@from.Value) <= to)
			{
				var currentRevisionId = long.Parse(@from.Value);

				if ((currentRevisionId + pageSize) < to)
				{
					result.Add(new RevisionRange(@from, (currentRevisionId + pageSize - 1).ToString()));
				}
				else
				{
					result.Add(new RevisionRange(@from, to.ToString()));
				}

				@from = (currentRevisionId + pageSize).ToString();
			}
			return result.ToArray();
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:20,代码来源:VersionControlSystemMock.cs


示例20: GetFromAndBefore

        public IEnumerable<RevisionRange> GetFromAndBefore(RevisionId fromRevision, RevisionId toRevision, int pageSize)
        {
	        var command = new LogCommand();
			if (string.IsNullOrEmpty(fromRevision.Value))
			{
				if (string.IsNullOrEmpty(toRevision.Value))
				{
					command = command.WithAdditionalArgument("-d {0:yyyy-MM-dd} to {1:yyyy-MM-dd}".Fmt(fromRevision.Time.Value, toRevision.Time.Value));
				}
				else
				{
					var to = new RevSpec(toRevision.Value);
					command = command.WithRevision(RevSpec.To(to));
					command = command.WithAdditionalArgument("-d >{0:yyyy-MM-dd}".Fmt(fromRevision.Time.Value));
				}
			}
			else
			{
				var from = new RevSpec(fromRevision.Value);
				if (string.IsNullOrEmpty(toRevision.Value))
				{
					command = command.WithAdditionalArgument("-d <{0:yyyy-MM-dd}".Fmt(toRevision.Time.Value));
					command = command.WithRevision(RevSpec.From(from));
				}
				else
				{
					var to = new RevSpec(toRevision.Value);
					command = command.WithRevision(RevSpec.Range(from, to));
				}
			}

            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;
        }
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:40,代码来源:MercurialClient.cs



注:本文中的Tp.SourceControl.VersionControlSystem.RevisionId类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tpm2Lib.TpmHandle类代码示例发布时间:2022-05-26
下一篇:
C# Messages.AccountName类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap