@@ -253,16 +253,21 @@ public function update_config() {
253253 public function commit ( $ p_repo , $ p_data ) {
254254 if ( preg_match ( '/(\d+)/ ' , $ p_data , $ p_matches ) ) {
255255
256+ # Detect if there is a svn:log revprop change, assume not
257+ $ t_revprop = gpc_get_bool ( 'revprop ' , false );
258+
256259 $ t_url = $ p_repo ->url ;
257260 $ t_revision = $ p_matches [1 ];
258261 $ t_svnlog_xml = $ this ->svn_run ( "log -v $ t_url -r $ t_revision --xml " , $ p_repo );
259262
260- if ( SourceChangeset::exists ( $ p_repo ->id , $ t_revision ) ) {
261- echo "Revision $ t_revision already committed! \n" ;
262- return null ;
263+ if ( !$ t_revprop ) {
264+ if ( SourceChangeset::exists ( $ p_repo ->id , $ t_revision ) ) {
265+ echo sprintf ( plugin_lang_get ( 'revision_already_committed ' ), $ t_revision );
266+ return null ;
267+ }
263268 }
264269
265- return $ this ->process_svn_log_xml ( $ p_repo , $ t_svnlog_xml );
270+ return $ this ->process_svn_log_xml ( $ p_repo , $ t_svnlog_xml, $ t_revprop );
266271 }
267272 }
268273
@@ -441,9 +446,10 @@ public static function svn_binary( $p_path=null, $p_reset=false ) {
441446 * Parse the svn log output (with --xml option)
442447 * @param SourceRepo SVN repository object
443448 * @param string SVN log (XML formated)
449+ * @param boolean REVPROP change flag
444450 * @return SourceChangeset[] Changesets for the provided input (empty on error)
445451 */
446- private function process_svn_log_xml ( $ p_repo , $ p_svnlog_xml ) {
452+ private function process_svn_log_xml ( $ p_repo , $ p_svnlog_xml, $ p_revprop = false ) {
447453 $ t_changesets = array ();
448454 $ t_changeset = null ;
449455 $ t_comments = '' ;
@@ -530,6 +536,18 @@ private function process_svn_log_xml( $p_repo, $p_svnlog_xml ) {
530536 // Save changeset and append to array
531537 if ( !is_null ( $ t_changeset ) ) {
532538 if ( !is_blank ( $ t_changeset ->branch ) ) {
539+ if ( $ p_revprop ) {
540+ echo plugin_lang_get ( 'revprop_detected ' );
541+ $ t_existing_changeset = SourceChangeset::load_by_revision ( $ p_repo , $ t_changeset ->revision );
542+ $ t_changeset ->id = $ t_existing_changeset ->id ;
543+ $ t_changeset ->user_id = $ t_existing_changeset ->user_id ;
544+ $ t_changeset ->files = $ t_existing_changeset ->files ;
545+ $ t_old_bugs = array_unique ( Source_Parse_Buglinks ( $ t_existing_changeset ->message ));
546+ $ t_new_bugs = array_unique ( Source_Parse_Buglinks ( $ t_changeset ->message ));
547+ if ( count ( $ t_old_bugs ) >= count ( $ t_new_bugs )) {
548+ $ t_changeset ->__bugs = array_diff ( $ t_old_bugs , $ t_new_bugs );
549+ }
550+ }
533551 $ t_changeset ->save ();
534552 $ t_changesets [] = $ t_changeset ;
535553 }
0 commit comments