@@ -253,16 +253,21 @@ public function update_config() {
253
253
public function commit ( $ p_repo , $ p_data ) {
254
254
if ( preg_match ( '/(\d+)/ ' , $ p_data , $ p_matches ) ) {
255
255
256
+ # Detect if there is a svn:log revprop change, assume not
257
+ $ t_revprop = gpc_get_bool ( 'revprop ' , false );
258
+
256
259
$ t_url = $ p_repo ->url ;
257
260
$ t_revision = $ p_matches [1 ];
258
261
$ t_svnlog_xml = $ this ->svn_run ( "log -v $ t_url -r $ t_revision --xml " , $ p_repo );
259
262
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
+ }
263
268
}
264
269
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 );
266
271
}
267
272
}
268
273
@@ -441,9 +446,10 @@ public static function svn_binary( $p_path=null, $p_reset=false ) {
441
446
* Parse the svn log output (with --xml option)
442
447
* @param SourceRepo SVN repository object
443
448
* @param string SVN log (XML formated)
449
+ * @param boolean REVPROP change flag
444
450
* @return SourceChangeset[] Changesets for the provided input (empty on error)
445
451
*/
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 ) {
447
453
$ t_changesets = array ();
448
454
$ t_changeset = null ;
449
455
$ t_comments = '' ;
@@ -530,6 +536,18 @@ private function process_svn_log_xml( $p_repo, $p_svnlog_xml ) {
530
536
// Save changeset and append to array
531
537
if ( !is_null ( $ t_changeset ) ) {
532
538
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
+ }
533
551
$ t_changeset ->save ();
534
552
$ t_changesets [] = $ t_changeset ;
535
553
}
0 commit comments