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

C# VersionControl.ChangeSet类代码示例

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

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



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


示例16: FormatDialogTitle

		public virtual string FormatDialogTitle (ChangeSet changeSet, string title)
		{
			return null;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:4,代码来源:CommitDialogExtension.cs


示例17: Initialize

		/// <summary>
		/// Initialize the extension.
		/// </summary>
		/// <param name='changeSet'>
		/// The changeSet being committed
		/// </param>
		/// <returns>
		/// True if the extension is valid for the provided change set.
		/// False otherwise (the OnBeginCommit and OnEndCommit methods
		/// won't be called).
		/// </returns>
		public virtual bool Initialize (ChangeSet changeSet)
		{
			return true;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:15,代码来源:CommitDialogExtension.cs


示例18: CopyFrom

		public virtual void CopyFrom (ChangeSet other)
		{
			repo = other.repo;
			basePath = other.basePath;
			items = new List<ChangeSetItem> (other.items.Select (cit => cit.Clone()));
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:6,代码来源:ChangeSet.cs


示例19: CopyFrom

		public virtual void CopyFrom (ChangeSet other)
		{
			repo = other.repo;
			basePath = other.basePath;
			items = new List<ChangeSetItem> ();
			foreach (ChangeSetItem cit in other.items)
				items.Add (cit.Clone ());
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:8,代码来源:ChangeSet.cs


示例20: CommitWorker

			public CommitWorker (Repository vc, ChangeSet changeSet, CommitDialog dlg)
			{
				this.vc = vc;
				this.changeSet = changeSet;
				this.dlg = dlg;
			}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:6,代码来源:CommitCommand.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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