Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -670,7 +670,6 @@ |
671 | 671 | * @param $revs array of revision IDs |
672 | 672 | */ |
673 | 673 | public function addReferencesFrom( $revs ) { |
674 | | - $dbw = wfGetDB( DB_MASTER ); |
675 | 674 | $data = array(); |
676 | 675 | foreach ( array_unique( (array)$revs ) as $rev ) { |
677 | 676 | if ( $rev > $this->getId() ) { |
— | — | @@ -681,8 +680,13 @@ |
682 | 681 | ); |
683 | 682 | } |
684 | 683 | } |
685 | | - $dbw->insert( 'code_relations', $data, __METHOD__, array( 'IGNORE' ) ); |
| 684 | + $this->addReferences( $data ); |
686 | 685 | } |
| 686 | + |
| 687 | + private function addReferences( $data ) { |
| 688 | + $dbw = wfGetDB( DB_MASTER ); |
| 689 | + $dbw->insert( 'code_relations', $data, __METHOD__, array( 'IGNORE' ) ); |
| 690 | + } |
687 | 691 | |
688 | 692 | /** |
689 | 693 | * Same as addReferencesFrom(), but adds references from this revision to |
— | — | @@ -690,7 +694,6 @@ |
691 | 695 | * @param $revs array of revision IDs |
692 | 696 | */ |
693 | 697 | public function addReferencesTo( $revs ) { |
694 | | - $dbw = wfGetDB( DB_MASTER ); |
695 | 698 | $data = array(); |
696 | 699 | foreach ( array_unique( (array)$revs ) as $rev ) { |
697 | 700 | if ( $rev < $this->getId() ) { |
— | — | @@ -701,7 +704,7 @@ |
702 | 705 | ); |
703 | 706 | } |
704 | 707 | } |
705 | | - $dbw->insert( 'code_relations', $data, __METHOD__, array( 'IGNORE' ) ); |
| 708 | + $this->addReferences( $data ); |
706 | 709 | } |
707 | 710 | |
708 | 711 | /** |