diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-15 18:51:06 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-15 18:51:06 +0300 |
commit | 3214778ed8efc7a72ab40823e826ac2c64cfbfb3 (patch) | |
tree | d1eda04b63e02fcc2140aac502b9c6feabae5eed | |
parent | 67194c06c57ea32ecb70e8b97bc7037ac0e80751 (diff) |
Add support for version iteration
-rw-r--r-- | libbrep/common.cxx | 2 | ||||
-rw-r--r-- | libbrep/common.hxx | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/libbrep/common.cxx b/libbrep/common.cxx index 39fd0c7..2499f65 100644 --- a/libbrep/common.cxx +++ b/libbrep/common.cxx @@ -6,5 +6,5 @@ namespace brep { - const version wildcard_version (0, "0", nullopt, 0); + const version wildcard_version (0, "0", nullopt, 0, 0); } diff --git a/libbrep/common.hxx b/libbrep/common.hxx index ea74756..0172ba2 100644 --- a/libbrep/common.hxx +++ b/libbrep/common.hxx @@ -66,7 +66,8 @@ void assert (int); from(bpkg::version ((?).epoch, \ std::move ((?).upstream), \ std::move ((?).release), \ - (?).revision)) + (?).revision, \ + 0)) #pragma db map type(brep::optional_version) as(brep::_optional_version) \ to((?) \ @@ -81,7 +82,8 @@ void assert (int); ? bpkg::version ((?)->epoch, \ std::move ((?)->upstream), \ std::move ((?)->release), \ - (?)->revision) \ + (?)->revision, \ + 0) \ : brep::optional_version ()) namespace brep @@ -157,14 +159,14 @@ namespace brep #pragma db value transient struct upstream_version: version { - #pragma db member(upstream_) virtual(string) \ - get(this.upstream) \ - set(this = brep::version (0, std::move (?), std::string (), 0)) + #pragma db member(upstream_) virtual(string) \ + get(this.upstream) \ + set(this = brep::version (0, std::move (?), std::string (), 0, 0)) - #pragma db member(release_) virtual(optional_string) \ - get(this.release) \ - set(this = brep::version ( \ - 0, std::move (this.upstream), std::move (?), 0)) + #pragma db member(release_) virtual(optional_string) \ + get(this.release) \ + set(this = brep::version ( \ + 0, std::move (this.upstream), std::move (?), 0, 0)) upstream_version () = default; upstream_version (version v): version (move (v)) {} @@ -174,7 +176,7 @@ namespace brep void init (const canonical_version& cv, const upstream_version& uv) { - *this = version (cv.epoch, uv.upstream, uv.release, cv.revision); + *this = version (cv.epoch, uv.upstream, uv.release, cv.revision, 0); assert (cv.canonical_upstream == canonical_upstream && cv.canonical_release == canonical_release); } |