version_control_info
This crate provides a way to embed version control info into a crate, and provide that to other crates which depend on your crate.
Examples
To use this crate, you must use the version_control_info_build crate
in a build script to generate the version control info:
// build.rs
use generate_version_control_info;
use Error;
Then, in your crate, you can use the get!() macro to get the generated
version control info as a constant:
// main.rs
use Info;
const VCS_INFO: = get!;
The Info type contains the version control information which can be queried.
Notes
At the moment, this crate only supports git and mercurial repositories. Feel free to
open a pull request to add support for other repositories.
Note that cargo has been built primarily with support for git - external repository
dependencies must be specified as git repositories, and only git commit info is
bundled with the crate when it is published using the cargo package command. Therefore,
this crate works best when using git. See the [Source] type documentation for further
details.
Features
std: Links tostd. This feature is enabled by default.serde: Implements theSerializeandDeseiralizetraits on types in this crate. This feature is disabled by default.