public interface VcsLogProvider
Modifier and Type | Interface and Description |
---|---|
static interface |
VcsLogProvider.DetailedLogData
Container for the ordered list of commits together with their details, and references.
|
static interface |
VcsLogProvider.LogData
Container for references and users.
|
static interface |
VcsLogProvider.Requirements |
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<VcsLogProvider> |
LOG_PROVIDER_EP |
Modifier and Type | Method and Description |
---|---|
java.util.List<TimedVcsCommit> |
getCommitsMatchingFilter(VirtualFile root,
VcsLogFilterCollection filterCollection,
int maxCount)
Return commits, which correspond to the given filters.
|
java.util.Collection<java.lang.String> |
getContainingBranches(VirtualFile root,
Hash commitHash)
Returns the list of names of branches/references which contain the given commit.
|
java.lang.String |
getCurrentBranch(VirtualFile root)
Returns currently checked out branch in given root, or null if not on any branch or provided root is not under version control.
|
VcsUser |
getCurrentUser(VirtualFile root)
Returns the name of current user as specified for the given root,
or null if user didn't configure his name in the VCS settings.
|
default VcsLogDiffHandler |
getDiffHandler()
Returns
VcsLogDiffHandler for this provider in order to support comparing commits and with local version from log-based file history. |
default VcsLogFileHistoryHandler |
getFileHistoryHandler()
Returns
VcsLogFileHistoryHandler for this provider in order to support Log-based file history. |
<T> T |
getPropertyValue(VcsLogProperties.VcsLogProperty<T> property)
In order to tune log for it's VCS, provider may set value to one of the properties specified in
VcsLogProperties . |
VcsLogRefManager |
getReferenceManager()
Returns the
VcsLogRefManager which will be used to identify positions of references in the log table, on the branches panel,
and on the details panel. |
VcsKey |
getSupportedVcs()
Returns the VCS which is supported by this provider.
|
default VirtualFile |
getVcsRoot(Project project,
VirtualFile detectedRoot,
FilePath filePath)
Returns the VCS root which should be used by the file history instead of the root found by standard mechanism (through mappings).
|
VcsLogProvider.LogData |
readAllHashes(VirtualFile root,
Consumer<? super TimedVcsCommit> commitConsumer)
Reads the whole history.
|
VcsLogProvider.DetailedLogData |
readFirstBlock(VirtualFile root,
VcsLogProvider.Requirements requirements)
Reads the most recent commits from the log together with all repository references.
Commits should be at least topologically ordered, better considering commit time as well: they will be shown in the log in this order. |
default java.util.List<? extends VcsFullCommitDetails> |
readFullDetails(VirtualFile root,
java.util.List<java.lang.String> hashes)
Deprecated.
replaced by
readFullDetails(VirtualFile, List, Consumer) . |
default void |
readFullDetails(VirtualFile root,
java.util.List<java.lang.String> hashes,
Consumer<? super VcsFullCommitDetails> commitConsumer)
Reads full details for specified commits in the repository.
|
default void |
readFullDetails(VirtualFile root,
java.util.List<java.lang.String> hashes,
Consumer<? super VcsFullCommitDetails> commitConsumer,
boolean isForIndexing)
Deprecated.
replaced by
readFullDetails(VirtualFile, List, Consumer) . |
java.util.List<? extends VcsCommitMetadata> |
readMetadata(VirtualFile root,
java.util.List<java.lang.String> hashes)
Reads those details of the given commits, which are necessary to be shown in the log table and commit details.
|
default java.util.List<? extends VcsShortCommitDetails> |
readShortDetails(VirtualFile root,
java.util.List<java.lang.String> hashes)
Deprecated.
replaced by
readMetadata(VirtualFile, List) . |
default Hash |
resolveReference(java.lang.String ref,
VirtualFile root)
Checks that the given reference points to a valid commit in the given root, and returns the Hash of this commit.
|
Disposable |
subscribeToRootRefreshEvents(java.util.Collection<? extends VirtualFile> roots,
VcsLogRefresher refresher)
Starts listening to events from the certain VCS, which should lead to the log refresh.
|
static final ExtensionPointName<VcsLogProvider> LOG_PROVIDER_EP
VcsLogProvider.DetailedLogData readFirstBlock(VirtualFile root, VcsLogProvider.Requirements requirements) throws VcsException
requirements
- some limitations on commit data that should be returned, e.g. the number of commits.VcsException
VcsLogProvider.LogData readAllHashes(VirtualFile root, Consumer<? super TimedVcsCommit> commitConsumer) throws VcsException
VcsException
java.util.List<? extends VcsCommitMetadata> readMetadata(VirtualFile root, java.util.List<java.lang.String> hashes) throws VcsException
VcsException
default void readFullDetails(VirtualFile root, java.util.List<java.lang.String> hashes, Consumer<? super VcsFullCommitDetails> commitConsumer) throws VcsException
VcsException
VcsKey getSupportedVcs()
Returns the VCS which is supported by this provider.
If there will be several VcsLogProviders which support the same VCS, only one will be chosen. It is undefined, which one.
VcsLogRefManager getReferenceManager()
VcsLogRefManager
which will be used to identify positions of references in the log table, on the branches panel,
and on the details panel.Disposable subscribeToRootRefreshEvents(java.util.Collection<? extends VirtualFile> roots, VcsLogRefresher refresher)
Starts listening to events from the certain VCS, which should lead to the log refresh.
Returns disposable that unsubscribes from events.
Using a MessageBus
topic can help to accomplish that.
roots
- VCS roots which should be listened to.refresher
- The refresher which should be notified about the need of refresh.java.util.List<TimedVcsCommit> getCommitsMatchingFilter(VirtualFile root, VcsLogFilterCollection filterCollection, int maxCount) throws VcsException
Return commits, which correspond to the given filters.
maxCount
- maximum number of commits to request from the VCS, or -1 for unlimited.VcsException
VcsUser getCurrentUser(VirtualFile root) throws VcsException
VcsException
java.util.Collection<java.lang.String> getContainingBranches(VirtualFile root, Hash commitHash) throws VcsException
VcsException
<T> T getPropertyValue(VcsLogProperties.VcsLogProperty<T> property)
VcsLogProperties
.T
- Type of property value.property
- Property instance to return value for.java.lang.String getCurrentBranch(VirtualFile root)
root
- root for which branch is requested.default VcsLogDiffHandler getDiffHandler()
VcsLogDiffHandler
for this provider in order to support comparing commits and with local version from log-based file history.default VcsLogFileHistoryHandler getFileHistoryHandler()
VcsLogFileHistoryHandler
for this provider in order to support Log-based file history.default Hash resolveReference(java.lang.String ref, VirtualFile root)
default VirtualFile getVcsRoot(Project project, VirtualFile detectedRoot, FilePath filePath)
@Deprecated default java.util.List<? extends VcsShortCommitDetails> readShortDetails(VirtualFile root, java.util.List<java.lang.String> hashes) throws VcsException
readMetadata(VirtualFile, List)
.VcsException
@Deprecated default void readFullDetails(VirtualFile root, java.util.List<java.lang.String> hashes, Consumer<? super VcsFullCommitDetails> commitConsumer, boolean isForIndexing) throws VcsException
readFullDetails(VirtualFile, List, Consumer)
.VcsException
@Deprecated default java.util.List<? extends VcsFullCommitDetails> readFullDetails(VirtualFile root, java.util.List<java.lang.String> hashes) throws VcsException
readFullDetails(VirtualFile, List, Consumer)
.VcsException