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


C# VersionControl.ChangeSet類代碼示例

本文整理匯總了C#中MonoDevelop.VersionControl.ChangeSet的典型用法代碼示例。如果您正苦於以下問題:C# ChangeSet類的具體用法?C# ChangeSet怎麽用?C# ChangeSet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ChangeSet類屬於MonoDevelop.VersionControl命名空間,在下文中一共展示了ChangeSet類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreatePatch

		public static bool CreatePatch (ChangeSet items, bool test)
		{
			bool can = CanCreatePatch (items);
			if (test || !can){ return can; }
			
			Repository repo = items.Repository;
			items = items.Clone ();
			
			List<DiffInfo> diffs = new List<DiffInfo> ();
			
			object[] exts = AddinManager.GetExtensionObjects ("/MonoDevelop/VersionControl/CommitDialogExtensions", typeof(CommitDialogExtension), false);
			
			try {
				foreach (CommitDialogExtension ext in exts) {
					ext.Initialize (items);
					ext.OnBeginCommit (items);
				}
				diffs.AddRange (repo.PathDiff (items, false));
			} finally {
				foreach (CommitDialogExtension ext in exts) {
					ext.OnEndCommit (items, false);
					ext.Destroy ();
				}
			}
			
			string patch = repo.CreatePatch (diffs);
			string filename = string.Format ("{0}.diff", ((string)items.BaseLocalPath.FullPath).TrimEnd (Path.DirectorySeparatorChar));
			IdeApp.Workbench.NewDocument (filename, "text/x-diff", patch);
			return can;
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:30,代碼來源:CreatePatchCommand.cs

示例2: CommitWorker

			public CommitWorker (Repository vc, ChangeSet changeSet, CommitDialog dlg)
			{
				this.vc = vc;
				this.changeSet = changeSet;
				this.dlg = dlg;
				OperationType = VersionControlOperationType.Push;
			}
開發者ID:johnkg,項目名稱:monodevelop,代碼行數:7,代碼來源:CommitCommand.cs

示例3: Commit

		public static void Commit (Repository vc, ChangeSet changeSet)
		{
			try {
				if (vc.GetVersionInfo (changeSet.BaseLocalPath).CanCommit) {
					if (!VersionControlService.NotifyPrepareCommit (vc, changeSet))
						return;

					CommitDialog dlg = new CommitDialog (changeSet);
					try {
						if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
							if (VersionControlService.NotifyBeforeCommit (vc, changeSet)) {
								new CommitWorker (vc, changeSet, dlg).Start();
								return;
							}
						}
						dlg.EndCommit (false);
					} finally {
						dlg.Destroy ();
					}
					VersionControlService.NotifyAfterCommit (vc, changeSet, false);
				}
			}
			catch (Exception ex) {
					MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
			}
		}
開發者ID:telebovich,項目名稱:monodevelop,代碼行數:26,代碼來源:CommitCommand.cs

示例4: CreatePatch

		/// <summary>
		/// Creates a patch from a VersionControlItemList
		/// </summary>
		/// <param name="items">
		/// A <see cref="VersionControlItemList"/> from which to create a patch.
		/// </param>
		/// <param name="test">
		/// A <see cref="System.Boolean"/>: Whether this is a test run.
		/// </param>
		/// <returns>
		/// A <see cref="System.Boolean"/>: Whether the patch creation succeeded.
		/// </returns>
		public static bool CreatePatch (VersionControlItemList items, bool test)
		{
			bool can = CanCreatePatch (items);
			if (test || !can){ return can; }
			
			FilePath basePath = items.FindMostSpecificParent (FilePath.Null);
			if (FilePath.Empty == basePath)
				return false;
			
			ChangeSet cset = new ChangeSet (items[0].Repository, basePath);
			foreach (VersionControlItem item in items) {
				cset.AddFile (item.Path);
			}
			return CreatePatch (cset, test);
		}
開發者ID:harishamdani,項目名稱:monodevelop,代碼行數:27,代碼來源:CreatePatchCommand.cs

示例5: Initialize

		public override void Initialize (ChangeSet cset)
		{	
			this.cset = cset;
			msgLabel = new Label ();
			pathLabel = new Label ();
			msgLabel.Xalign = 0;
			pathLabel.Xalign = 0;
			vbox.PackStart (msgLabel, false, false, 0);
			vbox.PackStart (pathLabel, false, false, 3);
			
			GenerateLogEntries ();
			if (enabled) {
				ShowAll ();
				UpdateStatus ();
			}
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:16,代碼來源:CommitDialogExtensionWidget.cs

示例6: Commit

		public static bool Commit (Repository vc, ChangeSet changeSet, bool test)
		{
			try {
				if (changeSet.IsEmpty) {
					if (!test)
						MessageService.ShowMessage (GettextCatalog.GetString ("There are no changes to be committed."));
					return false;
				}
				
				if (vc.GetVersionInfo (changeSet.BaseLocalPath).CanCommit) {
					if (test)
						return true;

					if (!VersionControlService.NotifyPrepareCommit (vc, changeSet))
						return false;
					CommitDialog dlg = new CommitDialog (changeSet);
					try {
						if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
							if (VersionControlService.NotifyBeforeCommit (vc, changeSet)) {
								new CommitWorker (vc, changeSet, dlg).Start();
								return true;
							}
						}
						dlg.EndCommit (false);
					} finally {
						dlg.Destroy ();
					}
					VersionControlService.NotifyAfterCommit (vc, changeSet, false);
				}
				return false;
			}
			catch (Exception ex) {
				if (test)
					LoggingService.LogError (ex.ToString ());
				else
					MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
				return false;
			}
		}
開發者ID:OnorioCatenacci,項目名稱:monodevelop,代碼行數:39,代碼來源:CommitCommand.cs

示例7: Commit

		public static void Commit (Repository vc, ChangeSet changeSet)
		{
			try {
				VersionControlService.NotifyPrepareCommit (vc, changeSet);

				CommitDialog dlg = new CommitDialog (changeSet);
				try {
					if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
						VersionControlService.NotifyBeforeCommit (vc, changeSet);
							new CommitWorker (vc, changeSet, dlg).Start();
							return;
						}
					dlg.EndCommit (false);
				} finally {
					dlg.Destroy ();
					dlg.Dispose ();
				}
				VersionControlService.NotifyAfterCommit (vc, changeSet, false);
			}
			catch (Exception ex) {
				MessageService.ShowError (GettextCatalog.GetString ("Version control command failed."), ex);
			}
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:23,代碼來源:CommitCommand.cs

示例8: PathDiff

		// Returns a diff description between local files and the remote files.
		// baseLocalPath is the root path of the diff. localPaths is optional and
		// it can be a list of files to compare.
		public DiffInfo[] PathDiff (ChangeSet cset, bool remoteDiff)
		{
			return PathDiff (cset.BaseLocalPath, cset.Items.Select (i => i.LocalPath).ToArray (), remoteDiff);
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:7,代碼來源:Repository.cs

示例9: OnCommit

		protected abstract void OnCommit (ChangeSet changeSet, ProgressMonitor monitor);
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:1,代碼來源:Repository.cs

示例10: CanCreatePatch

		/// <summary>
		/// Determines whether a patch can be created 
		/// from a ChangeSet.
		/// </summary>
		public static bool CanCreatePatch (ChangeSet items) 
		{
			if (null == items || 0 == items.Count){ return false; }
			
			var vinfos = items.Repository.GetVersionInfo (items.Items.Select (i => i.LocalPath));
			return vinfos.All (i => i.CanRevert);
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:11,代碼來源:CreatePatchCommand.cs

示例11: OnEndCommit

		public override void OnEndCommit (ChangeSet changeSet, bool success)
		{
			if (!enabled)
				return;
				
			if (!success)
				RollbackMakefiles ();
			else
				DeleteBackupFiles ();
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:10,代碼來源:CommitDialogExtensionWidget.cs

示例12: Commit

		public override void Commit(ChangeSet changeSet, IProgressMonitor monitor)
		{
			throw new NotImplementedException();
		}
開發者ID:yvanjanssens,項目名稱:monodevelop-git,代碼行數:4,代碼來源:GitRepository.cs

示例13: NotifyAfterCommit

		internal static bool NotifyAfterCommit (Repository repo, ChangeSet changeSet, bool success)
		{
			if (EndCommit != null) {
				try {
					EndCommit (null, new CommitEventArgs (repo, changeSet, success));
				} catch (Exception ex) {
					MessageService.ShowException (ex);
					return false;
				}
			}
			if (success) {
				foreach (ChangeSetItem it in changeSet.Items)
					SetCommitComment (it.LocalPath, null, false);
				SaveComments ();
			}
			return true;
		}
開發者ID:kthguru,項目名稱:monodevelop,代碼行數:17,代碼來源:VersionControlService.cs

示例14: OnEndCommit

		/// <summary>
		/// Called when the commit operation ends
		/// </summary>
		/// <param name='changeSet'>
		/// The changeSet being committed
		/// </param>
		/// <param name='success'>
		/// True if the commit succeeded.
		/// </param>
		public virtual void OnEndCommit (ChangeSet changeSet, bool success)
		{
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:12,代碼來源:CommitDialogExtension.cs

示例15: OnBeginCommit

		/// <summary>
		/// Called when the commit operation starts.
		/// </summary>
		/// <param name='changeSet'>
		/// The changeSet being committed
		/// </param>
		/// <returns>
		/// False if the commit cannot continue.
		/// </returns>
		public virtual bool OnBeginCommit (ChangeSet changeSet)
		{
			return true;
		}
開發者ID:pabloescribanoloza,項目名稱:monodevelop,代碼行數:13,代碼來源:CommitDialogExtension.cs


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