);
ALTER TABLE patch_audit ADD COLUMN activity_id INTEGER NOT NULL
DEFAULT nextval('activity_seq');
+ALTER TABLE patch_audit ADD COLUMN committer VARCHAR NOT NULL
+ DEFAULT '';
CREATE OR REPLACE FUNCTION patch_audit() RETURNS trigger AS $$
DECLARE
|| CASE WHEN OLD.reviewers != NEW.reviewers
THEN '{reviewers}'::varchar[]
ELSE '{}'::varchar[] END
+ || CASE WHEN OLD.committer != NEW.committer
+ THEN '{committer}'::varchar[]
+ ELSE '{}'::varchar[] END
|| CASE WHEN OLD.date_closed IS DISTINCT FROM NEW.date_closed
THEN '{date_closed}'::varchar[]
ELSE '{}'::varchar[] END;
END IF;
IF (TG_OP = 'INSERT') THEN
cf := ARRAY['commitfest_id', 'commitfest_topic_id', 'name',
- 'patch_status_id', 'author', 'reviewers', 'date_closed'];
+ 'patch_status_id', 'author', 'reviewers',
+ 'committer', 'date_closed'];
END IF;
INSERT INTO patch_audit
(patch_id, change_type, changed_fields, commitfest_id, original_name,
to_commitfest_id, commitfest_topic_id, name,
- patch_status_id, author, reviewers, date_closed, last_updater,
- last_updated_time)
+ patch_status_id, author, reviewers, committer, date_closed,
+ last_updater, last_updated_time)
VALUES
(NEW.id, TG_OP, cf, acid, oname,
CASE WHEN cid != acid THEN cid ELSE NULL END,
NEW.commitfest_topic_id, NEW.name, NEW.patch_status_id, NEW.author,
- NEW.reviewers, NEW.date_closed, NEW.last_updater,
+ NEW.reviewers, NEW.committer, NEW.date_closed, NEW.last_updater,
NEW.last_updated_time);
-- For an update that changes the CommitFest, we enter two audit records,
-- one under each CommitFest.
(patch_id, change_type, changed_fields, commitfest_id,
original_name,
from_commitfest_id, commitfest_topic_id, name,
- patch_status_id, author, reviewers, date_closed, last_updater,
- last_updated_time)
+ patch_status_id, author, reviewers, committer, date_closed,
+ last_updater, last_updated_time)
VALUES
(NEW.id, TG_OP, cf, cid, oname, acid,
NEW.commitfest_topic_id, NEW.name, NEW.patch_status_id, NEW.author,
- NEW.reviewers, NEW.date_closed, NEW.last_updater,
+ NEW.reviewers, NEW.committer, NEW.date_closed, NEW.last_updater,
NEW.last_updated_time);
END IF;
RETURN NULL;
v := v || ('Reviewers = ' || CASE WHEN $1.reviewers = '' THEN 'Nobody'
ELSE $1.reviewers END)::varchar;
END IF;
+ IF ('committer' = ANY($1.changed_fields)) THEN
+ v := v || ('Committer = ' || CASE WHEN $1.committer = '' THEN 'Nobody'
+ ELSE $1.committer END)::varchar;
+ END IF;
IF ('date_closed' = ANY($1.changed_fields)) THEN
v := v || ('Date Closed = '
|| COALESCE($1.date_closed::varchar, 'NULL'))::varchar;
$r->set_title('Edit Patch');
$d = $r->db->select_one(<<EOM, $id);
SELECT id, commitfest_topic_id AS commitfest_topic, commitfest_id, name,
- patch_status_id AS patch_status, author, reviewers, date_closed
+ patch_status_id AS patch_status, author, reviewers, committer, date_closed
FROM patch_view WHERE id = ?
EOM
$r->error_exit('Patch not found.') if !defined $d;
EOM
$r->add_control('author', 'text', 'Author', 'required' => 1);
$r->add_control('reviewers', 'text', 'Reviewers');
+ $r->add_control('committer', 'text', 'Committer');
$r->add_control('date_closed', 'date', 'Date Closed');
if (!defined $id) {
$r->add_control('message_id', 'text',
my $id = $r->cgi_id();
my $d = $r->db->select_one(<<EOM, $id) if defined $id;
SELECT id, name, commitfest_id, commitfest, commitfest_topic_id,
- commitfest_topic, patch_status, author, reviewers, date_closed
+ commitfest_topic, patch_status, author, reviewers, committer, date_closed
FROM patch_view WHERE id = ?
EOM
$r->error_exit('Patch not found.') if !defined $d;