本文整理匯總了C#中MonoDevelop.VersionControl.Repository.Commit方法的典型用法代碼示例。如果您正苦於以下問題:C# Repository.Commit方法的具體用法?C# Repository.Commit怎麽用?C# Repository.Commit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.VersionControl.Repository
的用法示例。
在下文中一共展示了Repository.Commit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UpdateIsDone
public virtual void UpdateIsDone ()
{
string added = rootCheckout + "testfile";
File.Create (added).Close ();
repo.Add (added, false, new NullProgressMonitor ());
ChangeSet changes = repo.CreateChangeSet (repo.RootPath);
changes.AddFile (repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache));
changes.GlobalComment = "test";
repo.Commit (changes, new NullProgressMonitor ());
PostCommit (repo);
// Checkout a second repository.
FilePath second = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
Checkout (second, repoLocation);
repo2 = GetRepo (second, repoLocation);
added = second + "testfile2";
File.Create (added).Close ();
repo2.Add (added, false, new NullProgressMonitor ());
changes = repo.CreateChangeSet (repo.RootPath);
changes.AddFile (repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache));
changes.GlobalComment = "test2";
repo2.Commit (changes, new NullProgressMonitor ());
PostCommit (repo2);
repo.Update (repo.RootPath, true, new NullProgressMonitor ());
Assert.True (File.Exists (rootCheckout + "testfile2"));
DeleteDirectory (second);
}
示例2: UpdateIsDone
public virtual void UpdateIsDone()
{
AddFile ("testfile", null, true, true);
PostCommit (Repo);
// Checkout a second repository.
FilePath second = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
Checkout (second, RemoteUrl);
Repo2 = GetRepo (second, RemoteUrl);
ModifyPath (Repo2, ref second);
string added = second + "testfile2";
File.Create (added).Close ();
Repo2.Add (added, false, new NullProgressMonitor ());
ChangeSet changes = Repo2.CreateChangeSet (Repo2.RootPath);
changes.AddFile (Repo2.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache));
changes.GlobalComment = "test2";
Repo2.Commit (changes, new NullProgressMonitor ());
PostCommit (Repo2);
Repo.Update (Repo.RootPath, true, new NullProgressMonitor ());
Assert.True (File.Exists (LocalPath + "testfile2"));
Repo2.Dispose ();
DeleteDirectory (second);
}