コード例 #1
0
		private static bool RevertRevisions (Repository vc, string path, Revision revision, bool test, bool toRevision)
		{
			try {
				if (test) {
					return (vc.CanRevert (path));
				}
				
				string question = GettextCatalog.GetString (
				  "Are you sure you want to revert the selected resources to the revision specified (all local changes will be discarded)?");
				
				if (!toRevision)
					question = GettextCatalog.GetString (
					  "Are you sure you want to revert the changes from the revision selected on these resources?");
				
				if (MessageService.AskQuestion (question, 
				                                GettextCatalog.GetString ("Note: The reversion will occur in your working copy, so you will still need to perform a commit to complete it."),
				                                AlertButton.Cancel, AlertButton.Revert) != AlertButton.Revert)
					return false;

				new RevertWorker(vc, path, revision, toRevision).Start();
				return true;
			}
			catch (Exception ex) {
				if (test)
					LoggingService.LogError (ex.ToString ());
				else
					MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
				return false;
			}
		}
コード例 #2
0
ファイル: VersionInfo.cs プロジェクト: Kalnor/monodevelop
		public VersionInfo (FilePath localPath, string repositoryPath, bool isDirectory, VersionStatus status, Revision revision, VersionStatus remoteStatus, Revision remoteRevision)
		{
			this.localPath = localPath;
			this.repositoryPath = repositoryPath;
			this.isDirectory = isDirectory;
			this.status = status;
			this.revision = revision;
			this.remoteStatus = remoteStatus;
			this.remoteRevision = remoteRevision;
		}
コード例 #3
0
		public override string GetTextAtRevision(FilePath repositoryPath, Revision revision)
		{
			throw new NotImplementedException();
		}
コード例 #4
0
		public override void Checkout (FilePath path, Revision rev, bool recurse, IProgressMonitor monitor)
		{
		}
コード例 #5
0
		public Annotation (Revision revision, string author, DateTime date)
		{
			this.Revision = revision;
			this.Author = author;
			this.Date = date;
		}
コード例 #6
0
		public string GetTextAtRevision (FilePath repositoryPath, Revision revision)
		{
			return OnGetTextAtRevision (repositoryPath, revision);
		}
コード例 #7
0
		protected abstract void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor);
コード例 #8
0
		/// <summary>
		/// Returns the list of changes done in the given revision
		/// </summary>
		/// <param name='revision'>
		/// A revision
		/// </param>
		public RevisionPath[] GetRevisionChanges (Revision revision)
		{
			return OnGetRevisionChanges (revision);
		}
コード例 #9
0
 public Task <string> GetTextAtRevisionAsync(FilePath repositoryPath, Revision revision, CancellationToken cancellationToken = default)
 {
     return(OnGetTextAtRevisionAsync(repositoryPath, revision, cancellationToken));
 }
コード例 #10
0
 /// <summary>
 /// Returns a recursive diff set for a revision range.
 /// </summary>
 /// <param name="localPath">
 /// A <see cref="FilePath"/>: A local file path to diff;
 /// directories will be diffed recursively.
 /// </param>
 /// <param name="fromRevision">
 /// A <see cref="Revision"/>: The beginning revision
 /// </param>
 /// <param name="toRevision">
 /// A <see cref="Revision"/>: The ending revision
 /// </param>
 public virtual Task <DiffInfo []> PathDiffAsync(FilePath localPath, Revision fromRevision, Revision toRevision, CancellationToken cancellationToken)
 {
     return(Task.FromResult(Array.Empty <DiffInfo> ()));
 }
コード例 #11
0
        private static async Task <bool> RevertRevisionsAsync(Repository vc, string path, Revision revision, bool test, bool toRevision, CancellationToken cancellationToken)
        {
            try {
                if (test)
                {
                    if (vc.TryGetVersionInfo(path, out var info))
                    {
                        return(info.CanRevert);
                    }
                    return(false);
                }

                string question = GettextCatalog.GetString(
                    "Are you sure you want to revert the selected resources to the revision specified (all local changes will be discarded)?");

                if (!toRevision)
                {
                    question = GettextCatalog.GetString(
                        "Are you sure you want to revert the changes from the revision selected on these resources?");
                }

                if (MessageService.AskQuestion(question,
                                               GettextCatalog.GetString("Note: The reversion will occur in your working copy, so you will still need to perform a commit to complete it."),
                                               AlertButton.Cancel, AlertButton.Revert) != AlertButton.Revert)
                {
                    return(false);
                }

                await new RevertWorker(vc, path, revision, toRevision).StartAsync(cancellationToken);
                return(true);
            } catch (OperationCanceledException) {
                return(false);
            } catch (Exception ex) {
                if (test)
                {
                    LoggingService.LogError(ex.ToString());
                }
                else
                {
                    MessageService.ShowError(GettextCatalog.GetString("Version control command failed."), ex);
                }
                return(false);
            }
        }
コード例 #12
0
 public static Task <bool> RevertToRevisionAsync(Repository vc, string path, Revision revision, bool test, CancellationToken cancellationToken = default)
 {
     return(RevertRevisionsAsync(vc, path, revision, test, true, cancellationToken));
 }
コード例 #13
0
 public VersionInfo(FilePath localPath, string repositoryPath, bool isDirectory, VersionStatus status, Revision revision, VersionStatus remoteStatus, Revision remoteRevision)
 {
     this.localPath      = localPath;
     this.repositoryPath = repositoryPath;
     this.isDirectory    = isDirectory;
     this.status         = status;
     this.revision       = revision;
     this.remoteStatus   = remoteStatus;
     this.remoteRevision = remoteRevision;
 }
コード例 #14
0
ファイル: Repository.cs プロジェクト: poke/monodevelop
 public abstract string GetTextAtRevision(FilePath repositoryPath, Revision revision);
コード例 #15
0
ファイル: Repository.cs プロジェクト: nieve/monodevelop
		// Returns the revision history of a file
		public abstract Revision[] GetHistory (FilePath localFile, Revision since);
コード例 #16
0
ファイル: Repository.cs プロジェクト: nieve/monodevelop
		public abstract void RevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor);
コード例 #17
0
 protected abstract Task <string> OnGetTextAtRevisionAsync(FilePath repositoryPath, Revision revision, CancellationToken cancellationToken);
コード例 #18
0
		protected abstract Revision[] OnGetHistory (FilePath localFile, Revision since);
コード例 #19
0
 /// <summary>
 /// Retrieves annotations for a given path in the repository.
 /// </summary>
 /// <param name="repositoryPath">
 /// A <see cref="FilePath"/>
 /// </param>
 /// <param name="since">
 /// A <see cref="Revision"/>
 /// </param>
 /// <returns>
 /// A <see cref="Annotation"/> corresponding to each line
 /// of the file to which repositoryPath points.
 /// </returns>
 public virtual Task <Annotation []> GetAnnotationsAsync(FilePath repositoryPath, Revision since, CancellationToken cancellationToken = default)
 {
     return(Task.FromResult(new Annotation[0]));
 }
コード例 #20
0
		protected abstract void OnRevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor);
コード例 #21
0
 /// <summary>
 /// Returns the list of changes done in the given revision
 /// </summary>
 /// <param name='revision'>
 /// A revision
 /// </param>
 protected abstract Task <RevisionPath []> OnGetRevisionChangesAsync(Revision revision, CancellationToken cancellationToken);
コード例 #22
0
		/// <summary>
		/// Retrieves annotations for a given path in the repository.
		/// </summary>
		/// <param name="repositoryPath">
		/// A <see cref="FilePath"/>
		/// </param>
		/// <param name="since">
		/// A <see cref="Revision"/>
		/// </param>
		/// <returns>
		/// A <see cref="Annotation"/> corresponding to each line 
		/// of the file to which repositoryPath points.
		/// </returns>
		public virtual Annotation [] GetAnnotations (FilePath repositoryPath, Revision since)
		{
			return new Annotation[0];
		}
コード例 #23
0
 public Annotation(Revision revision, string author, DateTime date, string email) : this(revision, author, date, email, null)
 {
 }
コード例 #24
0
		public override string GetTextAtRevision (FilePath repositoryPath, Revision revision)
		{
			return null;
		}
コード例 #25
0
 protected abstract Task <Revision []> OnGetHistoryAsync(FilePath localFile, Revision since, CancellationToken cancellationToken);
コード例 #26
0
		public override void Checkout(FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor)
		{
			throw new NotImplementedException();
		}
コード例 #27
0
 protected abstract Task OnCheckoutAsync(FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor);
コード例 #28
0
ファイル: Repository.cs プロジェクト: poke/monodevelop
 public abstract void RevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor);
コード例 #29
0
 protected abstract Task OnRevertToRevisionAsync(FilePath localPath, Revision revision, ProgressMonitor monitor);
コード例 #30
0
			public RevertWorker(Repository vc, string path, Revision revision, bool toRevision) {
				this.vc = vc;
				this.path = path;
				this.revision = revision;
				this.toRevision = toRevision;
			}
コード例 #31
0
 /// <summary>
 /// Returns the list of changes done in the given revision
 /// </summary>
 /// <param name='revision'>
 /// A revision
 /// </param>
 public RevisionPath[] GetRevisionChanges(Revision revision)
 {
     return(OnGetRevisionChanges(revision));
 }
コード例 #32
0
ファイル: Repository.cs プロジェクト: nieve/monodevelop
		public abstract void Checkout (FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor);
コード例 #33
0
 // Returns the revision history of a file
 public Revision[] GetHistory(FilePath localFile, Revision since)
 {
     return(OnGetHistory(localFile, since));
 }
コード例 #34
0
ファイル: Repository.cs プロジェクト: nieve/monodevelop
		public abstract string GetTextAtRevision (FilePath repositoryPath, Revision revision);
コード例 #35
0
 protected abstract Revision[] OnGetHistory(FilePath localFile, Revision since);
コード例 #36
0
		// Returns the revision history of a file
		public Revision[] GetHistory (FilePath localFile, Revision since)
		{
			return OnGetHistory (localFile, since);
		}
コード例 #37
0
 public void Checkout(FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor)
 {
     ClearCachedVersionInfo(targetLocalPath);
     OnCheckout(targetLocalPath, rev, recurse, monitor);
 }
コード例 #38
0
		public void Checkout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor)
		{
			ClearCachedVersionInfo (targetLocalPath);
			OnCheckout (targetLocalPath, rev, recurse, monitor);
		}
コード例 #39
0
 protected abstract void OnCheckout(FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor);
コード例 #40
0
		public void RevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
		{
			ClearCachedVersionInfo (localPath);
			OnRevertToRevision (localPath, revision, monitor);
		}
コード例 #41
0
 public void RevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor)
 {
     ClearCachedVersionInfo(localPath);
     OnRevertToRevision(localPath, revision, monitor);
 }
コード例 #42
0
		/// <summary>
		/// Returns a recursive diff set for a revision range.
		/// </summary>
		/// <param name="localPath">
		/// A <see cref="FilePath"/>: A local file path to diff; 
		/// directories will be diffed recursively.
		/// </param>
		/// <param name="fromRevision">
		/// A <see cref="Revision"/>: The beginning revision
		/// </param>
		/// <param name="toRevision">
		/// A <see cref="Revision"/>: The ending revision
		/// </param>
		public virtual DiffInfo[] PathDiff (FilePath localPath, Revision fromRevision, Revision toRevision)
		{
			return new DiffInfo [0];
		}
コード例 #43
0
 protected abstract void OnRevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor);
コード例 #44
0
		protected abstract string OnGetTextAtRevision (FilePath repositoryPath, Revision revision);
コード例 #45
0
 /// <summary>
 /// Returns a recursive diff set for a revision range.
 /// </summary>
 /// <param name="localPath">
 /// A <see cref="FilePath"/>: A local file path to diff;
 /// directories will be diffed recursively.
 /// </param>
 /// <param name="fromRevision">
 /// A <see cref="Revision"/>: The beginning revision
 /// </param>
 /// <param name="toRevision">
 /// A <see cref="Revision"/>: The ending revision
 /// </param>
 public virtual DiffInfo[] PathDiff(FilePath localPath, Revision fromRevision, Revision toRevision)
 {
     return(new DiffInfo [0]);
 }
コード例 #46
0
		/// <summary>
		/// Returns the list of changes done in the given revision
		/// </summary>
		/// <param name='revision'>
		/// A revision
		/// </param>
		protected abstract RevisionPath[] OnGetRevisionChanges (Revision revision);
コード例 #47
0
 public string GetTextAtRevision(FilePath repositoryPath, Revision revision)
 {
     return(OnGetTextAtRevision(repositoryPath, revision));
 }
コード例 #48
0
		public Annotation (Revision revision, string author, DateTime date, string email, string text)
		{
			this.Revision = revision;
			this.Author = author;
			this.Date = date;
			this.Email = email;
			this.text = text;
		}
コード例 #49
0
 protected abstract string OnGetTextAtRevision(FilePath repositoryPath, Revision revision);
コード例 #50
0
		public override Revision[] GetHistory (FilePath sourcefile, Revision since)
		{
			return null;
		}
コード例 #51
0
 /// <summary>
 /// Returns the list of changes done in the given revision
 /// </summary>
 /// <param name='revision'>
 /// A revision
 /// </param>
 protected abstract RevisionPath[] OnGetRevisionChanges(Revision revision);
コード例 #52
0
		public override void RevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
		{
		}
コード例 #53
0
 public static bool RevertToRevision(Repository vc, string path, Revision revision, bool test)
 {
     return(RevertRevisions(vc, path, revision, test, true));
 }
コード例 #54
0
		public override Revision[] GetHistory(FilePath localFile, Revision since)
		{
			throw new NotImplementedException();
		}
コード例 #55
0
		public static bool RevertToRevision (Repository vc, string path, Revision revision, bool test)
		{
			return RevertRevisions (vc, path, revision, test, true);
		}
コード例 #56
0
		public override void RevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor)
		{
			throw new NotImplementedException();
		}
コード例 #57
0
ファイル: Repository.cs プロジェクト: poke/monodevelop
 // Returns the revision history of a file
 public abstract Revision[] GetHistory(FilePath localFile, Revision since);