diff --git a/SourceGithub/SourceGithub.php b/SourceGithub/SourceGithub.php index f1bebd8..8eef3c0 100644 --- a/SourceGithub/SourceGithub.php +++ b/SourceGithub/SourceGithub.php @@ -316,19 +316,17 @@ echo "processing $p_json->id ... "; if ( !SourceChangeset::exists( $p_repo->id, $p_json->id ) ) { - $t_user_id = user_get_id_by_email( $p_json->author->email ); - if ( false === $t_user_id ) { - $t_user_id = user_get_id_by_realname( $p_json->author->name ); - } - $t_parents = array(); foreach( $p_json->parents as $t_parent ) { $t_parents[] = $t_parent->id; } $t_changeset = new SourceChangeset( $p_repo->id, $p_json->id, $p_branch, - $p_json->authored_date, $p_json->author->name, - $p_json->message, $t_user_id ); + $p_json->authored_date, $p_json->author->name, $p_json->message ); + + $t_changeset->author_email = $p_json->author->email; + $t_changeset->committer = $p_json->committer->name; + $t_changeset->committer_email = $p_json->committer->email; foreach( $p_json->added as $t_added ) { $t_changeset->files[] = new SourceFile( 0, '', $t_added->filename, 'add' ); diff --git a/SourceGitweb/SourceGitweb.php b/SourceGitweb/SourceGitweb.php index 1f23e0b..ef6be70 100644 --- a/SourceGitweb/SourceGitweb.php +++ b/SourceGitweb/SourceGitweb.php @@ -290,6 +290,11 @@ $t_commit['author_email'] = $t_matches[2]; $t_commit['date'] = date( 'Y-m-d H:i:s', strtotime( $t_matches[3] ) ); + if( preg_match( '#committer([^<>]*) <([^<>]*)>#', $t_gitweb_data, $t_matches ) ) { + $t_commit['committer'] = $t_matches[1]; + $t_commit['committer_email'] = $t_matches[2]; + } + if( preg_match( '#parent]*>([a-f0-9]*)#', $t_gitweb_data, $t_matches ) ) { $t_commit['parent'] = $t_matches[1]; } @@ -328,21 +333,19 @@ $t_commit['files'][] = $t_file; } - # Start building the changeset - $t_user_id = user_get_id_by_email( $t_commit['author_email'] ); - if ( false === $t_user_id ) { - $t_user_id = user_get_id_by_realname( $t_commit['author'] ); - } - $t_parents = array(); if ( isset( $t_commit['parent'] ) ) { $t_parents[] = $t_commit['parent']; } $t_changeset = new SourceChangeset( $p_repo->id, $t_commit['revision'], $p_branch, - $t_commit['date'], $t_commit['author'], $t_commit['message'], $t_user_id, + $t_commit['date'], $t_commit['author'], $t_commit['message'], 0, ( isset( $t_commit['parent'] ) ? $t_commit['parent'] : '' ) ); + $t_changeset->author_email = $t_commit['author']; + $t_changeset->committer = $t_commit['committer']; + $t_changeset->committer_email = $t_commit['committer_email']; + foreach( $t_commit['files'] as $t_file ) { $t_changeset->files[] = new SourceFile( 0, $t_file['revision'], $t_file['filename'], $t_file['action'] ); } diff --git a/SourceSFSVN/SourceSFSVN.php b/SourceSFSVN/SourceSFSVN.php index b2a352b..969089f 100644 --- a/SourceSFSVN/SourceSFSVN.php +++ b/SourceSFSVN/SourceSFSVN.php @@ -258,10 +258,7 @@ $t_changesets[] = $t_changeset; } - $t_user_id = user_get_id_by_name( $t_matches[2] ); - $t_user_id = ( false === $t_user_id ? 0 : $t_user_id ); - - $t_changeset = new SourceChangeset( $p_repo->id, $t_matches[1], '', $t_matches[3] . ' ' . $t_matches[4], $t_matches[2], '', $t_user_id ); + $t_changeset = new SourceChangeset( $p_repo->id, $t_matches[1], '', $t_matches[3] . ' ' . $t_matches[4], $t_matches[2], '' ); $t_state = 2; diff --git a/SourceWebSVN/SourceWebSVN.php b/SourceWebSVN/SourceWebSVN.php index 5e4ceb5..454edad 100644 --- a/SourceWebSVN/SourceWebSVN.php +++ b/SourceWebSVN/SourceWebSVN.php @@ -280,10 +280,7 @@ $t_changesets[] = $t_changeset; } - $t_user_id = user_get_id_by_name( $t_matches[2] ); - $t_user_id = ( false === $t_user_id ? 0 : $t_user_id ); - - $t_changeset = new SourceChangeset( $p_repo->id, $t_matches[1], '', $t_matches[3] . ' ' . $t_matches[4], $t_matches[2], '', $t_user_id ); + $t_changeset = new SourceChangeset( $p_repo->id, $t_matches[1], '', $t_matches[3] . ' ' . $t_matches[4], $t_matches[2], '' ); $t_state = 2;