當前位置: 首頁>>代碼示例>>C#>>正文


C# RevCommit.GetShortMessage方法代碼示例

本文整理匯總了C#中NGit.Revwalk.RevCommit.GetShortMessage方法的典型用法代碼示例。如果您正苦於以下問題:C# RevCommit.GetShortMessage方法的具體用法?C# RevCommit.GetShortMessage怎麽用?C# RevCommit.GetShortMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NGit.Revwalk.RevCommit的用法示例。


在下文中一共展示了RevCommit.GetShortMessage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ToCommit

 private static Commit ToCommit(RevCommit commit, Repository repository)
 {
     return new Commit
     (
         repository,
         commit.Name,
         commit.GetShortMessage(),
         ToPerson(commit.GetAuthorIdent()),
         ToPerson(commit.GetCommitterIdent()),
         commit.GetCommitterIdent().GetWhen(),
         commit.Parents.Select(p => p.Name)
     );
 }
開發者ID:dineshkummarc,項目名稱:Ometh,代碼行數:13,代碼來源:Repository.cs

示例2: TestParse_WeirdHeaderOnlyCommit

 public virtual void TestParse_WeirdHeaderOnlyCommit()
 {
     StringBuilder b = new StringBuilder();
     b.Append("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n");
     b.Append("author A U. Thor <[email protected]> 1218123387 +0700\n");
     b.Append("committer C O. Miter <[email protected]> 1218123390 -0500\n");
     RevCommit c;
     c = new RevCommit(Id("9473095c4cb2f12aefe1db8a355fe3fafba42f67"));
     c.ParseCanonical(new RevWalk(db), Sharpen.Runtime.GetBytesForString(b.ToString(),
         "UTF-8"));
     NUnit.Framework.Assert.AreEqual(string.Empty, c.GetFullMessage());
     NUnit.Framework.Assert.AreEqual(string.Empty, c.GetShortMessage());
 }
開發者ID:charles-cai,項目名稱:ngit,代碼行數:13,代碼來源:RevCommitParseTest.cs

示例3: TestParse_explicit_bad_encoded

 public virtual void TestParse_explicit_bad_encoded()
 {
     ByteArrayOutputStream b = new ByteArrayOutputStream();
     b.Write(Sharpen.Runtime.GetBytesForString("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n"
         , "UTF-8"));
     b.Write(Sharpen.Runtime.GetBytesForString("author F\u00f6r fattare <[email protected]> 1218123387 +0700\n"
         , "ISO-8859-1"));
     b.Write(Sharpen.Runtime.GetBytesForString("committer C O. Miter <[email protected]> 1218123390 -0500\n"
         , "UTF-8"));
     b.Write(Sharpen.Runtime.GetBytesForString("encoding EUC-JP\n", "UTF-8"));
     b.Write(Sharpen.Runtime.GetBytesForString("\n", "UTF-8"));
     b.Write(Sharpen.Runtime.GetBytesForString("\u304d\u308c\u3044\n", "UTF-8"));
     b.Write(Sharpen.Runtime.GetBytesForString("\n", "UTF-8"));
     b.Write(Sharpen.Runtime.GetBytesForString("Hi\n", "UTF-8"));
     RevCommit c;
     c = new RevCommit(Id("9473095c4cb2f12aefe1db8a355fe3fafba42f67"));
     // bogus id
     c.ParseCanonical(new RevWalk(db), b.ToByteArray());
     NUnit.Framework.Assert.AreEqual("Japanese (EUC)", c.Encoding.EncodingName);
     NUnit.Framework.Assert.AreEqual("F\u00f6r fattare", c.GetAuthorIdent().GetName());
     NUnit.Framework.Assert.AreEqual("\u304d\u308c\u3044", c.GetShortMessage());
     NUnit.Framework.Assert.AreEqual("\u304d\u308c\u3044\n\nHi\n", c.GetFullMessage());
 }
開發者ID:charles-cai,項目名稱:ngit,代碼行數:23,代碼來源:RevCommitParseTest.cs

示例4: Rebase

		public bool Rebase ()
		{
			NGit.Api.Git git = new NGit.Api.Git (repo);
			
			if (aborted)
				return false;
			
			if (starting) {
				ObjectId headId = repo.Resolve (Constants.HEAD + "^{commit}");
				RevCommit headCommit = rw.ParseCommit (headId);
				oldHead = headCommit;
				ObjectId upstreamId = repo.Resolve (upstreamRef);
				RevCommit upstreamCommit = rw.ParseCommit (upstreamId);
				
				oldHead = headCommit;
				lastGoodHead = upstreamId;
				commitChain = new List<RevCommit> ();
			
				LogCommand cmd = new NGit.Api.Git(repo).Log().AddRange(upstreamId, headCommit);
				foreach (RevCommit commit in cmd.Call())
					commitChain.Add(commit);
				
				commitChain.Reverse ();
				currentMergeIndex = 0;
				
				// Checkout the upstream commit
				// Reset head to upstream
				GitUtil.HardReset (repo, upstreamRef);
				
				string rebaseDir = Path.Combine (repo.Directory, "rebase-apply");
				if (!Directory.Exists (rebaseDir))
					Directory.CreateDirectory (rebaseDir);
				
				string rebasingFile = Path.Combine (rebaseDir, "rebasing");
				if (!File.Exists (rebasingFile))
					File.WriteAllBytes (rebasingFile, new byte[0]);
				
				starting = false;
				monitor.BeginTask ("Applying local commits", commitChain.Count);
			}
			else {
				// Conflicts resolved. Continue.
				NGit.Api.AddCommand cmd = git.Add ();
				var conflicts = LastMergeResult.GetConflicts ();
				foreach (string conflictFile in conflicts.Keys) {
					cmd.AddFilepattern (conflictFile);
				}
				cmd.Call ();
				NGit.Api.CommitCommand commit = git.Commit ();
				commit.SetMessage (currentMergeCommit.GetFullMessage ());
				commit.SetAuthor (currentMergeCommit.GetAuthorIdent ());
				commit.SetCommitter (currentMergeCommit.GetCommitterIdent ());
				commit.Call();
			}
			
			// Merge commit by commit until the current head
			
			while (currentMergeIndex < commitChain.Count) {
				currentMergeCommit = commitChain[currentMergeIndex++];
				mergeResult = GitUtil.CherryPick (repo, currentMergeCommit);
				monitor.Log.WriteLine ("Applied '{0}'", currentMergeCommit.GetShortMessage ());
				monitor.Step (1);
				if (mergeResult.GetMergeStatus () == MergeStatus.CONFLICTING || mergeResult.GetMergeStatus () == MergeStatus.FAILED)
					return false;
				lastGoodHead = mergeResult.GetNewHead ();
			}
			
			monitor.EndTask ();
			CleanRebaseFile ();
			return true;
		}
開發者ID:nickname100,項目名稱:monodevelop,代碼行數:71,代碼來源:RebaseOperation.cs


注:本文中的NGit.Revwalk.RevCommit.GetShortMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。