diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-17 16:14:33 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-17 16:14:33 +0200 |
commit | 450702a232bf07a82c6ac74fe28dc7bc9cffe67c (patch) | |
tree | 88c1549e9fa8510cc8d4af270b6e9ffc9686fec5 /bpkg/manifest.cxx | |
parent | a38c7a609c85b54b31e4a50c3da4d39b7a338c1d (diff) |
Add ignore_revision to version::string()
Diffstat (limited to 'bpkg/manifest.cxx')
-rw-r--r-- | bpkg/manifest.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bpkg/manifest.cxx b/bpkg/manifest.cxx index 40f362e..b66d5d4 100644 --- a/bpkg/manifest.cxx +++ b/bpkg/manifest.cxx @@ -326,6 +326,22 @@ namespace bpkg canonical_upstream_.resize (cl); } + string version:: + string (bool ignore_revision) const + { + std::string v (epoch_ != 0 + ? to_string (epoch_) + "+" + upstream_ + : upstream_); + + if (!ignore_revision && revision_ != 0) + { + v += '-'; + v += to_string (revision_); + } + + return v; + } + // package_manifest // package_manifest:: |