diff --git a/Source/Source.API.php b/Source/Source.API.php index 9cff020..31e905e 100644 --- a/Source/Source.API.php +++ b/Source/Source.API.php @@ -348,8 +348,10 @@ var $revision; var $parent; var $branch; + var $ported; var $timestamp; var $author; + var $author_email; var $message; var $files; # array of SourceFile's @@ -365,20 +367,24 @@ * @param string Author * @param string Commit message */ - function __construct( $p_repo_id, $p_revision, $p_branch='', $p_timestamp='', $p_author='', $p_message='', $p_user_id=0, $p_parent='' ) { - $this->id = 0; - $this->user_id = $p_user_id; - $this->repo_id = $p_repo_id; - $this->revision = $p_revision; - $this->parent = $p_parent; - $this->branch = $p_branch; - $this->timestamp = $p_timestamp; - $this->author = $p_author; - $this->message = $p_message; + function __construct( $p_repo_id, $p_revision, $p_branch='', $p_timestamp='', + $p_author='', $p_message='', $p_user_id=0, $p_parent='', $p_ported='', $p_author_email='' ) { - $this->files = array(); - $this->bugs = array(); - $this->__bugs = array(); + $this->id = 0; + $this->user_id = $p_user_id; + $this->repo_id = $p_repo_id; + $this->revision = $p_revision; + $this->parent = $p_parent; + $this->branch = $p_branch; + $this->ported = $p_ported; + $this->timestamp = $p_timestamp; + $this->author = $p_author; + $this->author_email = $p_author_email; + $this->message = $p_message; + + $this->files = array(); + $this->bugs = array(); + $this->__bugs = array(); } /** @@ -393,11 +399,15 @@ $t_changeset_table = plugin_table( 'changeset', 'Source' ); if ( 0 == $this->id ) { # create - $t_query = "INSERT INTO $t_changeset_table ( repo_id, revision, parent, branch, user_id, timestamp, author, message ) VALUES ( " . + $t_query = "INSERT INTO $t_changeset_table ( repo_id, revision, parent, branch, user_id, + timestamp, author, message, ported, author_email ) VALUES ( " . db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . - db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . db_param() . ' )'; - db_query_bound( $t_query, array( $this->repo_id, $this->revision, $this->parent, $this->branch, - $this->user_id, $this->timestamp, $this->author, $this->message ) ); + db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . + db_param() . ', ' . db_param() . ' )'; + db_query_bound( $t_query, array( + $this->repo_id, $this->revision, $this->parent, $this->branch, + $this->user_id, $this->timestamp, $this->author, $this->message, + $this->ported, $this->author_email ) ); $this->id = db_insert_id( $t_changeset_table ); @@ -409,9 +419,14 @@ $t_query = "UPDATE $t_changeset_table SET repo_id=" . db_param() . ', revision=' . db_param() . ', parent=' . db_param() . ', branch=' . db_param() . ', user_id=' . db_param() . ', timestamp=' . db_param() . ', author=' . db_param() . ', message=' . db_param() . + ', ported=' . db_param() . ', author_email=' . db_param() . ' WHERE id=' . db_param(); - db_query_bound( $t_query, array( $this->repo_id, $this->revision, $this->branch, $this->user_id, - $this->timestamp, $this->author, $this->message, $this->id ) ); + db_query_bound( $t_query, array( + $this->repo_id, $this->revision, + $this->parent, $this->branch, $this->user_id, + $this->timestamp, $this->author, $this->message, + $this->ported, $this->author_email, + $this->id ) ); } foreach( $this->files as $t_file ) { @@ -542,7 +557,9 @@ } $t_row = db_fetch_array( $t_result ); - $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], $t_row['user_id'], $t_row['parent'] ); + $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], + $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], + $t_row['user_id'], $t_row['parent'], $t_row['ported'], $t_row['author_email'] ); $t_changeset->id = $t_row['id']; return $t_changeset; @@ -566,7 +583,9 @@ } $t_row = db_fetch_array( $t_result ); - $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], $t_row['user_id'], $t_row['parent'] ); + $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], + $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], + $t_row['user_id'], $t_row['parent'], $t_row['ported'], $t_row['author_email'] ); $t_changeset->id = $t_row['id']; return $t_changeset; @@ -591,7 +610,9 @@ $t_changesets = array(); while ( $t_row = db_fetch_array( $t_result ) ) { - $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], $t_row['user_id'], $t_row['parent'] ); + $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], + $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], + $t_row['user_id'], $t_row['parent'], $t_row['ported'], $t_row['author_email'] ); $t_changeset->id = $t_row['id']; if ( $p_load_files ) { @@ -622,7 +643,9 @@ $t_changesets = array(); while ( $t_row = db_fetch_array( $t_result ) ) { - $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], $t_row['user_id'], $t_row['parent'] ); + $t_changeset = new SourceChangeset( $t_row['repo_id'], $t_row['revision'], + $t_row['branch'], $t_row['timestamp'], $t_row['author'], $t_row['message'], + $t_row['user_id'], $t_row['parent'], $t_row['ported'], $t_row['author_email'] ); $t_changeset->id = $t_row['id']; if ( $p_load_files ) { diff --git a/Source/Source.php b/Source/Source.php index ec9959f..c02e6aa 100644 --- a/Source/Source.php +++ b/Source/Source.php @@ -136,6 +136,13 @@ array( 'AddColumnSQL', array( plugin_table( 'changeset' ), " parent C(250) NOTNULL DEFAULT \" '' \" " ) ), + # 2008-10-02 + array( 'AddColumnSQL', array( plugin_table( 'changeset' ), " + ported C(250) NOTNULL DEFAULT \" '' \" + " ) ), + array( 'AddColumnSQL', array( plugin_table( 'changeset' ), " + author_email C(250) NOTNULL DEFAULT \" '' \" + " ) ), ); }