+ array(select rh.parent_id::bytea from revision_history rh where rh.id = t.id order by rh.parent_rank)
+ as parents
+ from tmp_bytea t
+ left join revision r on t.id = r.id
+ left join person a on a.id = r.author
+ left join person c on c.id = r.committer;
+ return;
+end
+$$;
+
+CREATE OR REPLACE FUNCTION swh_revision_get_by(origin_id bigint, branch_name bytea = NULL::bytea, "date" timestamp with time zone = NULL::timestamp with time zone) RETURNS SETOF revision_entry