From: jenkins-bot Date: Tue, 18 Nov 2014 19:01:41 +0000 (+0000) Subject: Merge "Refactor profiling output from profiling" X-Git-Tag: 1.31.0-rc.0~13264 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=04340a21c5afbdf4004a50c362afab5c06e5d59b;hp=b8d93fb4fd0661c4994e6895b5e654516ba1c965;p=lhc%2Fweb%2Fwiklou.git Merge "Refactor profiling output from profiling" --- diff --git a/docs/uidesign/mediawiki.action.history.diff.html b/docs/uidesign/mediawiki.action.history.diff.html index 5edcfb86c6..615558f206 100644 --- a/docs/uidesign/mediawiki.action.history.diff.html +++ b/docs/uidesign/mediawiki.action.history.diff.html @@ -1,57 +1,91 @@ - + + + - -

-This show various styles for our diff action, the background being hardcoded to gray (#C0C0C0) The reference style sheet is:

-

-resources/mediawiki.action/mediawiki.action.history.diff.css. -

-

-This file might help us fix our diff colors which have been a recurring issues among the community for a loooong time.

- -

-First, show the diff mostly like it would be chown on a wiki

- + + +

This show various styles for our diff action. Style sheet: resources/src/mediawiki.action/mediawiki.action.history.diff.css.

+

This file might help us fix our diff colors which have been a recurring issues among the community for a loooong time.

+

Try it out in print mode, too. Style sheet: resources/src/mediawiki.action/mediawiki.action.history.diff.print.css.

+ +

Practical example copied from MediaWiki's HTML output:

+ +
+ + + + + + - - + + - + -
-
- Some content deleted / replaced -
−
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
- Some content added / replacement -
Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- + + − + +   + + + − +
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+   + + +   + +   + + + +   +
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+   +
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+ + +   + +   + + + + − +
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ + +
Excepteur sint occaecat cupidatat non proident, sunt reprehenderit in voluptate in culpa qui officia deserunt mollit anim.
+ + +   + + + + + +   + + +
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+ + -

-Below are some basic lines being applied one or two classes. Mainly for debugging purposes

+

Below are some basic lines being applied one or two classes. Mainly for debugging purposes.

- - - + - - - + +
Diff
diff-addedline: added line
diff-deletedline: deleted line
diff-context: context
Same as above with a <span> child element having the diffchange class
Same as above with a <ins> or <del> child element having the diffchange class:
Diffchange
- Added line + diffchange -
- Deleted line + diffchange -
- Context + diffchange -
Added line + diffchange
Deleted line + diffchange
diff --git a/includes/User.php b/includes/User.php index 8fcdab26cf..f9f4b6a4bb 100644 --- a/includes/User.php +++ b/includes/User.php @@ -565,12 +565,10 @@ class User implements IDBAccessObject { * @return int|null The corresponding user's ID, or null if user is nonexistent */ public static function idFromName( $name ) { - $nt = Title::makeTitleSafe( NS_USER, $name ); - if ( is_null( $nt ) ) { - // Illegal name - return null; - } - + // We don't want to call Title::makeTitleSafe yet, since that call path + // ends up needing the user language, which ends up trying to load the + // user object, which ends up back here (bug 54193). + $nt = Title::makeTitle( NS_USER, $name ); if ( isset( self::$idCacheByName[$name] ) ) { return self::$idCacheByName[$name]; } diff --git a/includes/filebackend/FileBackendMultiWrite.php b/includes/filebackend/FileBackendMultiWrite.php index bfffcc0f2a..8b6eaca20c 100644 --- a/includes/filebackend/FileBackendMultiWrite.php +++ b/includes/filebackend/FileBackendMultiWrite.php @@ -314,6 +314,8 @@ class FileBackendMultiWrite extends FileBackend { $mStat = $mBackend->getFileStat( array( 'src' => $mPath, 'latest' => true ) ); if ( $mStat === null || ( $mSha1 !== false && !$mStat ) ) { // sanity $status->fatal( 'backend-fail-internal', $this->name ); + wfDebugLog( 'FileOperation', __METHOD__ + . ': File is not available on the master backend' ); continue; // file is not available on the master backend... } // Check of all clone backends agree with the master... @@ -326,6 +328,8 @@ class FileBackendMultiWrite extends FileBackend { $cStat = $cBackend->getFileStat( array( 'src' => $cPath, 'latest' => true ) ); if ( $cStat === null || ( $cSha1 !== false && !$cStat ) ) { // sanity $status->fatal( 'backend-fail-internal', $cBackend->getName() ); + wfDebugLog( 'FileOperation', __METHOD__ + . ': File is not available on the clone backend' ); continue; // file is not available on the clone backend... } if ( $mSha1 === $cSha1 ) { diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 625b9b40ed..7234474081 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -537,6 +537,7 @@ class SwiftFileBackend extends FileBackendStore { return $status; // already there } elseif ( $stat === null ) { $status->fatal( 'backend-fail-internal', $this->name ); + wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); return $status; } @@ -568,6 +569,7 @@ class SwiftFileBackend extends FileBackendStore { $status->fatal( 'backend-fail-usable', $params['dir'] ); } else { $status->fatal( 'backend-fail-internal', $this->name ); + wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); } return $status; @@ -588,6 +590,7 @@ class SwiftFileBackend extends FileBackendStore { $status->fatal( 'backend-fail-usable', $params['dir'] ); } else { $status->fatal( 'backend-fail-internal', $this->name ); + wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); } return $status; @@ -607,6 +610,7 @@ class SwiftFileBackend extends FileBackendStore { return $status; // ok, nothing to do } elseif ( !is_array( $stat ) ) { $status->fatal( 'backend-fail-internal', $this->name ); + wfDebugLog( 'SwiftBackend', __METHOD__ . ': cannot get container stat' ); return $status; } @@ -1253,6 +1257,7 @@ class SwiftFileBackend extends FileBackendStore { if ( $rcode != 204 && $rcode !== 202 ) { $status->fatal( 'backend-fail-internal', $this->name ); + wfDebugLog( 'SwiftBackend', __METHOD__ . ': unexpected rcode value (' . $rcode . ')' ); } return $status; diff --git a/resources/Resources.php b/resources/Resources.php index cfac8a9c7c..c39ba3bf41 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1053,7 +1053,10 @@ return array( 'group' => 'mediawiki.action.history', ), 'mediawiki.action.history.diff' => array( - 'styles' => 'resources/src/mediawiki.action/mediawiki.action.history.diff.css', + 'styles' => array( + 'resources/src/mediawiki.action/mediawiki.action.history.diff.css', + 'resources/src/mediawiki.action/mediawiki.action.history.diff.print.css' => array( 'media' => 'print' ), + ), 'group' => 'mediawiki.action.history', 'targets' => array( 'desktop', 'mobile' ), ), diff --git a/resources/src/mediawiki.action/mediawiki.action.history.diff.css b/resources/src/mediawiki.action/mediawiki.action.history.diff.css index 092a59768e..0887476e42 100644 --- a/resources/src/mediawiki.action/mediawiki.action.history.diff.css +++ b/resources/src/mediawiki.action/mediawiki.action.history.diff.css @@ -1,6 +1,6 @@ -/* -** Diff rendering -*/ +/*! + * Diff rendering + */ table.diff { border: none; border-spacing: 4px; diff --git a/resources/src/mediawiki.action/mediawiki.action.history.diff.print.css b/resources/src/mediawiki.action/mediawiki.action.history.diff.print.css new file mode 100644 index 0000000000..76b5c9b7ae --- /dev/null +++ b/resources/src/mediawiki.action/mediawiki.action.history.diff.print.css @@ -0,0 +1,16 @@ +/*! + * Diff rendering + */ +td.diff-context, +td.diff-addedline .diffchange, +td.diff-deletedline .diffchange { + background-color: transparent; +} + +td.diff-addedline .diffchange { + text-decoration: underline; +} + +td.diff-deletedline .diffchange { + text-decoration: line-through; +} diff --git a/resources/src/mediawiki.legacy/commonPrint.css b/resources/src/mediawiki.legacy/commonPrint.css index 9405719f96..a52ccb67fa 100644 --- a/resources/src/mediawiki.legacy/commonPrint.css +++ b/resources/src/mediawiki.legacy/commonPrint.css @@ -323,44 +323,6 @@ div.gallerytext { word-wrap: break-word; } -/** - * Diff rendering - */ -table.diff { - background: white; -} - -td.diff-otitle { - background: #ffffff; -} - -td.diff-ntitle { - background: #ffffff; -} - -td.diff-addedline { - background: #ccffcc; - font-size: smaller; - border: solid 2px black; -} - -td.diff-deletedline { - background: #ffffaa; - font-size: smaller; - border: dotted 2px black; -} - -td.diff-context { - background: #eeeeee; - font-size: smaller; -} - -.diffchange { - color: silver; - font-weight: bold; - text-decoration: underline; -} - /** * Table rendering * As on shared.css but with white background.