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

C# Revwalk.RevCommit类代码示例

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

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



RevCommit类属于NGit.Revwalk命名空间,在下文中一共展示了RevCommit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CherryPickResult

		/// <param name="newHead">commit the head points at after this cherry-pick</param>
		/// <param name="cherryPickedRefs">list of successfully cherry-picked <code>Ref</code>'s
		/// 	</param>
		public CherryPickResult(RevCommit newHead, IList<Ref> cherryPickedRefs)
		{
			this.status = CherryPickResult.CherryPickStatus.OK;
			this.newHead = newHead;
			this.cherryPickedRefs = cherryPickedRefs;
			this.failingPaths = null;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:10,代码来源:CherryPickResult.cs


示例2: ValidateStashedCommit

		/// <summary>Core validation to be performed on all stashed commits</summary>
		/// <param name="commit"></param>
		/// <exception cref="System.IO.IOException">System.IO.IOException</exception>
		private void ValidateStashedCommit(RevCommit commit)
		{
			NUnit.Framework.Assert.IsNotNull(commit);
			Ref stashRef = db.GetRef(Constants.R_STASH);
			NUnit.Framework.Assert.IsNotNull(stashRef);
			NUnit.Framework.Assert.AreEqual(commit, stashRef.GetObjectId());
			NUnit.Framework.Assert.IsNotNull(commit.GetAuthorIdent());
			NUnit.Framework.Assert.AreEqual(commit.GetAuthorIdent(), commit.GetCommitterIdent
				());
			NUnit.Framework.Assert.AreEqual(2, commit.ParentCount);
			// Load parents
			RevWalk walk = new RevWalk(db);
			try
			{
				foreach (RevCommit parent in commit.Parents)
				{
					walk.ParseBody(parent);
				}
			}
			finally
			{
				walk.Release();
			}
			NUnit.Framework.Assert.AreEqual(1, commit.GetParent(1).ParentCount);
			NUnit.Framework.Assert.AreEqual(head, commit.GetParent(1).GetParent(0));
			NUnit.Framework.Assert.IsFalse(commit.Tree.Equals(head.Tree), "Head tree matches stashed commit tree"
				);
			NUnit.Framework.Assert.AreEqual(head, commit.GetParent(0));
			NUnit.Framework.Assert.IsFalse(commit.GetFullMessage().Equals(commit.GetParent(1)
				.GetFullMessage()));
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:34,代码来源:StashCreateCommandTest.cs


示例3: Add

		/// <summary>Add a commit if it does not have a flag set yet, then set the flag.</summary>
		/// <remarks>
		/// Add a commit if it does not have a flag set yet, then set the flag.
		/// <p>
		/// This method permits the application to test if the commit has the given
		/// flag; if it does not already have the flag than the commit is added to
		/// the queue and the flag is set. This later will prevent the commit from
		/// being added twice.
		/// </remarks>
		/// <param name="c">commit to add.</param>
		/// <param name="queueControl">flag that controls admission to the queue.</param>
		public void Add(RevCommit c, RevFlag queueControl)
		{
			if (!c.Has(queueControl))
			{
				c.Add(queueControl);
				Add(c);
			}
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:19,代码来源:AbstractRevQueue.cs


示例4: Include

		/// <exception cref="NGit.Errors.StopWalkException"></exception>
		/// <exception cref="NGit.Errors.MissingObjectException"></exception>
		/// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		public override bool Include(RevWalk walker, RevCommit cmit)
		{
			if (skip > count++)
			{
				return false;
			}
			return true;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:12,代码来源:SkipRevFilter.cs


示例5: Include

		/// <exception cref="NGit.Errors.StopWalkException"></exception>
		/// <exception cref="NGit.Errors.MissingObjectException"></exception>
		/// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		public override bool Include(RevWalk walker, RevCommit cmit)
		{
			count++;
			if (count > maxCount)
			{
				throw StopWalkException.INSTANCE;
			}
			return true;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:13,代码来源:MaxCountRevFilter.cs


示例6: CompareCommits

		/// <summary>
		/// Compares two commits and returns a list of files that have changed
		/// </summary>
		public static IEnumerable<DiffEntry> CompareCommits (NGit.Repository repo, RevCommit reference, RevCommit compared)
		{
			var changes = new List<DiffEntry>();
			if (reference == null && compared == null)
				return changes;
			ObjectId refTree = (reference != null ? reference.Tree.Id : ObjectId.ZeroId);
			ObjectId comparedTree = (compared != null ? compared.Tree.Id : ObjectId.ZeroId);
			return CompareCommits (repo, refTree, comparedTree);
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:12,代码来源:GitUtil.cs


示例7: Commit

			public virtual PlotCommitListTest.CommitListAssert Commit(RevCommit id)
			{
				NUnit.Framework.Assert.IsTrue(this.pcl.Count > this.nextIndex, "Unexpected end of list at pos#"
					 + this.nextIndex);
				this.current = this.pcl[this.nextIndex++];
				NUnit.Framework.Assert.AreEqual(id.Id, this.current.Id, "Expected commit not found at pos#"
					 + (this.nextIndex - 1));
				return this;
			}
开发者ID:shoff,项目名称:ngit,代码行数:9,代码来源:PlotCommitListTest.cs


示例8: GetCommitChanges

		/// <summary>
		/// Returns a list of files that have changed in a commit
		/// </summary>
		public static IEnumerable<Change> GetCommitChanges (NGit.Repository repo, RevCommit commit)
		{
			var treeIds = new[] { commit.Tree.Id }.Concat (commit.Parents.Select (c => c.Tree.Id)).ToArray ();
			var walk = new TreeWalk (repo);
			walk.Reset (treeIds);
			walk.Recursive = true;
			walk.Filter = AndTreeFilter.Create (AndTreeFilter.ANY_DIFF, AndTreeFilter.ALL);
			
			return CalculateCommitDiff (repo, walk, new[] { commit }.Concat (commit.Parents).ToArray ());
		}
开发者ID:joaonunesk,项目名称:monodevelop,代码行数:13,代码来源:GitUtil.cs


示例9: Add

		public override void Add(RevCommit c)
		{
			BlockRevQueue.Block b = head;
			if (b == null || !b.CanUnpop())
			{
				b = free.NewBlock();
				b.ResetToEnd();
				b.next = head;
				head = b;
			}
			b.Unpop(c);
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:12,代码来源:LIFORevQueue.cs


示例10: CheckoutCommit

		/// <exception cref="System.InvalidOperationException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		private void CheckoutCommit(RevCommit commit)
		{
			RevWalk walk = new RevWalk(db);
			RevCommit head = walk.ParseCommit(db.Resolve(Constants.HEAD));
			DirCacheCheckout dco = new DirCacheCheckout(db, head.Tree, db.LockDirCache(), commit
				.Tree);
			dco.SetFailOnConflict(true);
			dco.Checkout();
			walk.Release();
			// update the HEAD
			RefUpdate refUpdate = db.UpdateRef(Constants.HEAD, true);
			refUpdate.SetNewObjectId(commit);
			refUpdate.ForceUpdate();
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:16,代码来源:RebaseCommandTest.cs


示例11: diff_Commits

 public static List<DiffEntry> diff_Commits(this API_NGit nGit, RevCommit from_RevCommit, RevCommit to_RevCommit)
 {
     if (nGit.repository().notNull())
         try
         {
             var outputStream = NGit_Factory.New_OutputStream();
             var diffFormater = new DiffFormatter(outputStream);
             diffFormater.SetRepository(nGit.repository());
             return diffFormater.Scan(from_RevCommit, to_RevCommit).toList();
         }
         catch (Exception ex)
         {
             ex.log("[API_NGit][diff]");
         }
     return new List<DiffEntry>();
 }
开发者ID:njmube,项目名称:FluentSharp,代码行数:16,代码来源:Diff_ExtensionMethods.cs


示例12: CompareCommits

		/// <summary>
		/// Compares two commits and returns a list of files that have changed
		/// </summary>
		public static IEnumerable<Change> CompareCommits (NGit.Repository repo, RevCommit reference, RevCommit compared)
		{
			var changes = new List<Change>();
			if (reference == null && compared == null)
				return changes;
			ObjectId refTree = (reference != null ? reference.Tree.Id : ObjectId.ZeroId);
			ObjectId comparedTree = (compared != null ? compared.Tree.Id : ObjectId.ZeroId);
			var walk = new TreeWalk (repo);
			if (reference == null || compared == null)
				walk.Reset ((reference ?? compared).Tree.Id);
			else
				walk.Reset (new AnyObjectId[] {refTree, comparedTree});
			walk.Recursive = true;
			walk.Filter = AndTreeFilter.Create(TreeFilter.ANY_DIFF, TreeFilter.ALL);

			return CalculateCommitDiff (repo, walk, new[] { reference, compared });
		}
开发者ID:stewartwhaley,项目名称:monodevelop,代码行数:20,代码来源:GitUtil.cs


示例13: Add

		public override void Add(RevCommit c)
		{
			DateRevQueue.Entry q = head;
			long when = c.commitTime;
			DateRevQueue.Entry n = NewEntry(c);
			if (q == null || when > q.commit.commitTime)
			{
				n.next = q;
				head = n;
			}
			else
			{
				DateRevQueue.Entry p = q.next;
				while (p != null && p.commit.commitTime > when)
				{
					q = p;
					p = q.next;
				}
				n.next = q.next;
				q.next = n;
			}
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:22,代码来源:DateRevQueue.cs


示例14: Add

		public override void Add(RevCommit c)
		{
			BlockRevQueue.Block b = tail;
			if (b == null)
			{
				b = free.NewBlock();
				b.Add(c);
				head = b;
				tail = b;
				return;
			}
			else
			{
				if (b.IsFull())
				{
					b = free.NewBlock();
					tail.next = b;
					tail = b;
				}
			}
			b.Add(c);
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:22,代码来源:FIFORevQueue.cs


示例15: GetFileContent

		private string GetFileContent(RevCommit commit, string path)
		{
			return _git.GetFileContent(commit, path);
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:4,代码来源:GitVersionControlSystem.cs


示例16: GetTextFileContentSafe

		private string GetTextFileContentSafe(RevCommit commit, string path)
		{
			try
			{
				return GetFileContent(commit, path);
			}
			catch
			{
				return string.Empty;
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:11,代码来源:GitVersionControlSystem.cs


示例17: GetDiff

		private DiffResult GetDiff(string path, RevCommit parent, RevCommit commit)
		{
			var fileContent = GetTextFileContentSafe(commit, path);
			var previousRevisionFileContent = GetTextFileContentSafe(parent, path);
			var diff = _diffProcessor.GetDiff(previousRevisionFileContent, fileContent);

			diff.LeftPanRevisionId = parent.Id.Name;
			diff.RightPanRevisionId = commit.Id.Name;

			return diff;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:11,代码来源:GitVersionControlSystem.cs


示例18: Assume

		/// <summary>Assume a commit is available on the recipient's side.</summary>
		/// <remarks>
		/// Assume a commit is available on the recipient's side.
		/// <p>
		/// In order to fetch from a bundle the recipient must have any assumed
		/// commit. Each assumed commit is explicitly recorded in the bundle header
		/// to permit the recipient to validate it has these objects.
		/// </remarks>
		/// <param name="c">
		/// the commit to assume being available. This commit should be
		/// parsed and not disposed in order to maximize the amount of
		/// debugging information available in the bundle stream.
		/// </param>
		public virtual void Assume(RevCommit c)
		{
			if (c != null)
			{
				assume.AddItem(c);
			}
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:20,代码来源:BundleWriter.cs


示例19: Find

 /// <summary>
 /// Find commits that are reachable from <code>start</code> until a commit
 /// that is reachable from <code>end</code> is encountered.
 /// </summary>
 /// <remarks>
 /// Find commits that are reachable from <code>start</code> until a commit
 /// that is reachable from <code>end</code> is encountered. In other words,
 /// Find of commits that are in <code>start</code>, but not in
 /// <code>end</code>.
 /// <p>
 /// Note that this method calls
 /// <see cref="RevWalk.Reset()">RevWalk.Reset()</see>
 /// at the beginning.
 /// Also note that the existing rev filter on the walk is left as-is, so be
 /// sure to set the right rev filter before calling this method.
 /// </remarks>
 /// <param name="walk">the rev walk to use</param>
 /// <param name="start">the commit to start counting from</param>
 /// <param name="end">
 /// the commit where counting should end, or null if counting
 /// should be done until there are no more commits
 /// </param>
 /// <returns>the commits found</returns>
 /// <exception cref="NGit.Errors.MissingObjectException">NGit.Errors.MissingObjectException
 /// 	</exception>
 /// <exception cref="NGit.Errors.IncorrectObjectTypeException">NGit.Errors.IncorrectObjectTypeException
 /// 	</exception>
 /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
 public static IList<RevCommit> Find(RevWalk walk, RevCommit start, RevCommit end)
 {
     walk.Reset();
     walk.MarkStart(start);
     if (end != null)
     {
         walk.MarkUninteresting(end);
     }
     IList<RevCommit> commits = new AList<RevCommit>();
     foreach (RevCommit c in walk)
     {
         commits.AddItem(c);
     }
     return commits;
 }
开发者ID:asperwin,项目名称:ngit,代码行数:43,代码来源:RevWalkUtils.cs


示例20: Count

 // Utility class
 /// <summary>
 /// Count the number of commits that are reachable from <code>start</code>
 /// until a commit that is reachable from <code>end</code> is encountered.
 /// </summary>
 /// <remarks>
 /// Count the number of commits that are reachable from <code>start</code>
 /// until a commit that is reachable from <code>end</code> is encountered. In
 /// other words, count the number of commits that are in <code>start</code>,
 /// but not in <code>end</code>.
 /// <p>
 /// Note that this method calls
 /// <see cref="RevWalk.Reset()">RevWalk.Reset()</see>
 /// at the beginning.
 /// Also note that the existing rev filter on the walk is left as-is, so be
 /// sure to set the right rev filter before calling this method.
 /// </remarks>
 /// <param name="walk">the rev walk to use</param>
 /// <param name="start">the commit to start counting from</param>
 /// <param name="end">
 /// the commit where counting should end, or null if counting
 /// should be done until there are no more commits
 /// </param>
 /// <returns>the number of commits</returns>
 /// <exception cref="NGit.Errors.MissingObjectException">NGit.Errors.MissingObjectException
 /// 	</exception>
 /// <exception cref="NGit.Errors.IncorrectObjectTypeException">NGit.Errors.IncorrectObjectTypeException
 /// 	</exception>
 /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
 public static int Count(RevWalk walk, RevCommit start, RevCommit end)
 {
     return Find(walk, start, end).Count;
 }
开发者ID:asperwin,项目名称:ngit,代码行数:33,代码来源:RevWalkUtils.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Transport.PackParser类代码示例发布时间:2022-05-26
下一篇:
C# Dircache.DirCacheEntry类代码示例发布时间: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