On writing VCS backends

Last updated on
30 April 2025

In the versioncontrol_fakevcs/ subdirectory of the Version Control API module, there exists an example backend implementation called "FakeVCS backend" which demonstrates how functions and their result data might look like. This is a free-for-all for backend module authors who can simply copy-and-paste apidox and function signatures into their own backends and then use the demo code as a template for their implementations.

A backend does not need to implement all functions that the Version Control API defines. The idea is that functionality for retrieving fundamental log information - that is, operations including their associated items and labels - is mandatory and likely to be stored in the database. (That twist also enables detailed operation queries across repositories and backends.) More advanced functionality like retrieving directory/file contents or file annotations, and listing all branches and tags of an item, is optional for backends to implement. That's because it's likely to directly interface to the VCS instead of querying the database, and this functionality is both harder to code and potentially slower than the log retrieval functions.

If a user of the API makes use of an optional function then that user has to check whether the function exists or not before calling it, using versioncontrol_backend_implements().

Help improve this page

Page status: Not set

You can: