Output number of conflicts
authorSam Reed <reedy@wikimedia.org>
Sat, 24 Jan 2015 00:43:26 +0000 (00:43 +0000)
committerSam Reed <reedy@wikimedia.org>
Sat, 24 Jan 2015 00:56:54 +0000 (00:56 +0000)
Change-Id: I1e52db4c3bc60ab41cff3f86aa565a99ffc564ef

maintenance/namespaceDupes.php

index cbc389b..62ddaef 100644 (file)
@@ -172,15 +172,24 @@ class NamespaceConflictChecker extends Maintenance {
                        return true;
                }
 
+               $resolveableCount = 0;
+
                $ok = true;
                foreach ( $conflicts as $row ) {
                        $resolvable = $this->reportConflict( $row, $suffix );
                        $ok = $ok && $resolvable;
+
+                       if ( $resolvable ) {
+                               $resolveableCount++;
+                       }
+
                        if ( $fix && ( $resolvable || $suffix != '' ) ) {
                                $ok = $this->resolveConflict( $row, $resolvable, $suffix ) && $ok;
                        }
                }
 
+               $this->output( "{$count} conflicts. {$resolveableCount} are resolveable." );
+
                return $ok;
        }
 
@@ -260,7 +269,8 @@ class NamespaceConflictChecker extends Maintenance {
                        $row->oldtitle,
                        $newTitle->getNamespace(),
                        $newTitle->getDBkey(),
-                       $newTitle->getPrefixedText() ) );
+                       $newTitle->getPrefixedText() )
+               );
 
                $id = $newTitle->getArticleID();
                if ( $id ) {