vcs_integration_for_plugins.md: Add code formatting to titles

This commit is contained in:
Karol Lewandowski 2024-04-08 12:57:56 +02:00
parent 22e0312ec2
commit bdc1e02f2b

View File

@ -1,6 +1,6 @@
# Version Control Systems
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Version Control Systems
<link-summary>Overview of the Version Control Integration API allowing to implement a custom Version Control System support.</link-summary>
@ -10,7 +10,7 @@ Reference: [OSS plugins providing VCS](https://jb.gg/ipe?extensions=com.intellij
## Key Concepts
### FilePath
### `FilePath`
A [`FilePath`](%gh-ic%/platform/ide-core/src/com/intellij/openapi/vcs/FilePath.java) represents a path to a file or directory on disk or in the VCS repository.
Unlike a [virtual file](virtual_file.md), a `FilePath` can represent a path to a file which doesn't exist on disk.
@ -21,13 +21,13 @@ To create instances of `FilePath`, the [`VcsContextFactory`](%gh-ic%/platform/vc
`FilePath` representing paths in a VCS repository, rather than local paths, are created using `VcsContextFactory.createFilePathOnNonLocal()`.
The `FilePath.isNonLocal()` method returns `true` for such files.
### Revision Number
### `VcsRevisionNumber`
A [`VcsRevisionNumber`](%gh-ic%/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/history/VcsRevisionNumber.java) represents a revision number of the file.
If the VCS stores revision numbers as simple integers, the standard [`VcsRevisionNumber`](%gh-ic%/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/history/VcsRevisionNumber.java) `Int` implementation can be used.
If the VCS has a more complex format of revision numbers (like CVS, which uses a series of numbers delimited with dots), the plugin can provide a custom implementation.
### ContentRevision
### `ContentRevision`
A [`ContentRevision`](%gh-ic%/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/changes/ContentRevision.java) represents a particular revision of a file, which exists either locally or in a VCS repository.
It has three main attributes:
@ -44,12 +44,12 @@ For binary revisions, the result of `getContent()` is undefined, and `getBinaryC
A useful class which can be used to represent the current on-disk version of a particular file is [`CurrentContentRevision`](%gh-ic%/platform/vcs-api/src/com/intellij/openapi/vcs/changes/CurrentContentRevision.java).
### FileStatus
### `FileStatus`
A [`FileStatus`](%gh-ic%/platform/editor-ui-api/src/com/intellij/openapi/vcs/FileStatus.java) represents a status of a file in regard to VCS (unversioned, not changed, added, modified and so on).
It determines the color used to render the name of the file in the UI.
### Change
### `Change`
A [`Change`](%gh-ic%/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/vcs/changes/Change.java) represents a single file operation (creation, modification, move/rename or deletion) from a VCS point of view.
A Change can represent either a modification which the user has performed locally and not yet committed, a committed modification, or some other type of modification (for example, a shelved change or a difference between two arbitrary revisions).
@ -63,7 +63,7 @@ A move or rename is represented by a `Change` where the before revision and the
A custom file status can be specified for a `Change` if it represents a non-standard modification of the file (for example, a file which has been merged with conflicts).
If a custom file status has not been specified, the status is calculated automatically from the change type.
### ChangeList
### `ChangeList`
A [`ChangeList`](%gh-ic%/platform/vcs-api/src/com/intellij/openapi/vcs/changes/ChangeList.java) represents a named group of related changes.
There are two main kinds of changelists:
@ -83,7 +83,7 @@ There are two main kinds of changelists:
This section describes the different components which comprise a VCS integration plugin, roughly in the same order as they should be implemented.
### AbstractVcs
### `AbstractVcs`
This is the main entry point for a VCS plugin, which is used by the IntelliJ Platform to retrieve all other services provided by the plugin.
Register `AbstractVcs` implementation in `com.intellij.vcs` extension point in <path>[plugin.xml](plugin_configuration_file.md)</path>, as shown in the following example:
@ -99,7 +99,7 @@ Register `AbstractVcs` implementation in `com.intellij.vcs` extension point in <
Here `name` is the unique name of the VCS (this must match the string returned by your implementation of `AbstractVcs.getName()`), and `vcsClass` is your implementation class.
### ChangeProvider
### `ChangeProvider`
[`ChangeProvider`](%gh-ic%/platform/vcs-api/src/com/intellij/openapi/vcs/changes/ChangeProvider.java) is responsible for tracking user changes to the working copy, and reporting these changes to the IntelliJ Platform core.
An implementation of this class is returned from [`AbstractVcs.getChangeProvider()`](%gh-ic%/platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcs.java).