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; } }
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; }
public override string GetTextAtRevision(FilePath repositoryPath, Revision revision) { throw new NotImplementedException(); }
public override void Checkout (FilePath path, Revision rev, bool recurse, IProgressMonitor monitor) { }
public Annotation (Revision revision, string author, DateTime date) { this.Revision = revision; this.Author = author; this.Date = date; }
public string GetTextAtRevision (FilePath repositoryPath, Revision revision) { return OnGetTextAtRevision (repositoryPath, revision); }
protected abstract void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor);
/// <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); }
public Task <string> GetTextAtRevisionAsync(FilePath repositoryPath, Revision revision, CancellationToken cancellationToken = default) { return(OnGetTextAtRevisionAsync(repositoryPath, revision, cancellationToken)); }
/// <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> ())); }
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); } }
public static Task <bool> RevertToRevisionAsync(Repository vc, string path, Revision revision, bool test, CancellationToken cancellationToken = default) { return(RevertRevisionsAsync(vc, path, revision, test, true, cancellationToken)); }
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; }
public abstract string GetTextAtRevision(FilePath repositoryPath, Revision revision);
// Returns the revision history of a file public abstract Revision[] GetHistory (FilePath localFile, Revision since);
public abstract void RevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor);
protected abstract Task <string> OnGetTextAtRevisionAsync(FilePath repositoryPath, Revision revision, CancellationToken cancellationToken);
protected abstract Revision[] OnGetHistory (FilePath localFile, Revision since);
/// <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])); }
protected abstract void OnRevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor);
/// <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);
/// <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]; }
public Annotation(Revision revision, string author, DateTime date, string email) : this(revision, author, date, email, null) { }
public override string GetTextAtRevision (FilePath repositoryPath, Revision revision) { return null; }
protected abstract Task <Revision []> OnGetHistoryAsync(FilePath localFile, Revision since, CancellationToken cancellationToken);
public override void Checkout(FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor) { throw new NotImplementedException(); }
protected abstract Task OnCheckoutAsync(FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor);
public abstract void RevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor);
protected abstract Task OnRevertToRevisionAsync(FilePath localPath, Revision revision, ProgressMonitor monitor);
public RevertWorker(Repository vc, string path, Revision revision, bool toRevision) { this.vc = vc; this.path = path; this.revision = revision; this.toRevision = toRevision; }
/// <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)); }
public abstract void Checkout (FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor);
// Returns the revision history of a file public Revision[] GetHistory(FilePath localFile, Revision since) { return(OnGetHistory(localFile, since)); }
public abstract string GetTextAtRevision (FilePath repositoryPath, Revision revision);
protected abstract Revision[] OnGetHistory(FilePath localFile, Revision since);
// Returns the revision history of a file public Revision[] GetHistory (FilePath localFile, Revision since) { return OnGetHistory (localFile, since); }
public void Checkout(FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor) { ClearCachedVersionInfo(targetLocalPath); OnCheckout(targetLocalPath, rev, recurse, monitor); }
public void Checkout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor) { ClearCachedVersionInfo (targetLocalPath); OnCheckout (targetLocalPath, rev, recurse, monitor); }
protected abstract void OnCheckout(FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor);
public void RevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor) { ClearCachedVersionInfo (localPath); OnRevertToRevision (localPath, revision, monitor); }
public void RevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor) { ClearCachedVersionInfo(localPath); OnRevertToRevision(localPath, revision, monitor); }
/// <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]; }
protected abstract void OnRevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor);
protected abstract string OnGetTextAtRevision (FilePath repositoryPath, Revision revision);
/// <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]); }
/// <summary> /// Returns the list of changes done in the given revision /// </summary> /// <param name='revision'> /// A revision /// </param> protected abstract RevisionPath[] OnGetRevisionChanges (Revision revision);
public string GetTextAtRevision(FilePath repositoryPath, Revision revision) { return(OnGetTextAtRevision(repositoryPath, revision)); }
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; }
protected abstract string OnGetTextAtRevision(FilePath repositoryPath, Revision revision);
public override Revision[] GetHistory (FilePath sourcefile, Revision since) { return null; }
/// <summary> /// Returns the list of changes done in the given revision /// </summary> /// <param name='revision'> /// A revision /// </param> protected abstract RevisionPath[] OnGetRevisionChanges(Revision revision);
public override void RevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor) { }
public static bool RevertToRevision(Repository vc, string path, Revision revision, bool test) { return(RevertRevisions(vc, path, revision, test, true)); }
public override Revision[] GetHistory(FilePath localFile, Revision since) { throw new NotImplementedException(); }
public static bool RevertToRevision (Repository vc, string path, Revision revision, bool test) { return RevertRevisions (vc, path, revision, test, true); }
public override void RevertToRevision(FilePath localPath, Revision revision, IProgressMonitor monitor) { throw new NotImplementedException(); }
// Returns the revision history of a file public abstract Revision[] GetHistory(FilePath localFile, Revision since);