public interface ISourceControlDoc 50's source-control service: what the project's version control says, and the two verbs that change it.
Remarks
A façade that outlives the provider's discovery (#1505). Whether the project is in a working tree is found out lazily, on the pool, by the first status sweep — so there is no provider to publish when the editor is built, and there may never be one. This is published instead, once, and its answers move under it: IsKnown turns true when a sweep lands, and stays false for a project that is not under source control.
⚠ Swept when the project is rescanned, not when a panel is open. The editor sweeps once at startup and again on every IProjectSession.Rescanned — the file watcher draining, Refresh, a revert — so Show History and Revert know whether they are available before the content browser has ever been opened. Every provider call runs on the thread pool, never on the frame thread; Swept and Reverted are raised on the frame thread.
⚠ Neither Revert nor Restore asks, and neither can be undone. Both write files on disk, and the undo stack holds documents. Asking — with the files named in the question — is the command's, which is a name for these; a script putting back what it generated has nobody to ask.
Fields and properties (3)
string? NameWhat the provider is called in a menu or a notification, or null when there is none (yet).
bool IsSoughtWhether the project has been looked at — after which a null Name means it is not in a working tree.
bool IsKnownWhether a status sweep has landed, which is what a source-control verb's enablement asks.
Events (2)
Action? SweptRaised on the frame thread after a sweep's answer has been taken.
Action? RevertedRaised on the frame thread after a Revert or Restore has finished and the project has been rescanned.
Methods (6)
SourceControlStatus Status(string path)What source control says about a path, a folder taking the strongest answer under it.
void Sweep()Asks for a fresh sweep of the whole working tree, off the frame thread.
ValueTask<IReadOnlyList<SourceControlRevision>> HistoryAsync(string path, int limit)The commits that touched a file, newest first.
ValueTask<SourceControlDiff> DiffAsync(string path, string revision)What changed in a file, at a revision or since the last commit.
void Revert(IReadOnlyList<string> paths)Throws away the changes to some files, without asking, then rescans and says so.
void Restore(string path, SourceControlRevision revision)Writes an old version of a file over the working tree's, without asking, then rescans and says so.
Used by (8)
- AssetRevisionsVixen.Editor.App
- ContentBrowsingVixen.Editor.App
- EditorApplicationVixen.Editor.App
- ProjectSourceControlVixen.Editor.App
- ServiceReachTestsVixen.Editor.App.Tests
- SourceControlHarnessVixen.Editor.App.Tests
- SourceControlModuleVixen.Editor.App
- SourceControlModuleTestsVixen.Editor.App.Tests