summaryrefslogtreecommitdiffstats
path: root/src/db/pkgbases.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/pkgbases.rs')
-rw-r--r--src/db/pkgbases.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/db/pkgbases.rs b/src/db/pkgbases.rs
index 1513928..ba52472 100644
--- a/src/db/pkgbases.rs
+++ b/src/db/pkgbases.rs
@@ -45,10 +45,7 @@ pub fn get_pkgbase_by_id(db: &Db, id: i64) -> Result<Option<Pkgbase>> {
})
}
-/// The release a pkgbase currently points at, if it points at one. This is a
-/// pointer stored on the pkgbase row, so reading it is a persistence question,
-/// not a review one — the watcher needs it to decide what a change is a change
-/// *from*, and review must not be the only way to ask.
+/// The release a pkgbase currently points at, if it points at one.
pub fn accepted_release_for(db: &Db, pb: &Pkgbase) -> Result<Option<ReleaseRow>> {
match pb.current_accepted_release_id {
Some(id) => release_by_id(db, id),
@@ -64,15 +61,8 @@ pub fn set_aur_head(writer: &Writer, pkgbase_id: i64, head: &str, mirror: &str)
})
}
-/// Compare-and-set the accepted-release pointer.
-///
-/// Test-tier only, and the reason is worth keeping next to it: production
-/// performs this CAS inside a transaction through `cas_accepted_release_in`,
-/// which is what `pipeline::publish` calls at publish.rs:208. This standalone
-/// form takes a `Writer` and is called by nothing in the crate — `tests/db.rs`
-/// alone pins that the pointer moves once and refuses the second time. The two
-/// names differ by three characters, which is exactly how a name-match census
-/// once credited this function with a production caller it never had.
+/// Compare-and-set the accepted-release pointer. Production does its CAS inside
+/// a transaction through `cas_accepted_release_in`.
#[cfg(feature = "test-support")]
pub fn cas_accepted_release(writer: &Writer, pkgbase_id: i64, expected: Option<i64>, new_id: i64) -> Result<bool> {
writer.tx(move |tx| {