Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/213775
Change subject: Make the output of UnifiedDiffFormatter match diff -u
......................................................................
Make the output of UnifiedDiffFormatter match diff -u
GNU 'diff -u' prefixes each line with either a space, a '+', or a '-'.
UnifiedDiffFormatter does the same, but it also adds an additional column of
whitespace between the prefix and the line. GNU diff only does that in
non-unified mode.
Fix this by implementing lines() in UnifiedDiffFormatter, overriding the parent
class implementation.
Bug: T100069
Change-Id: I1bf1b8e6d1d5aceb2c3836548f492f7edebe5a12
(cherry picked from commit 066fcb80a1e7be8cf8d356dec47a9976d636b2c7)
---
M includes/diff/UnifiedDiffFormatter.php
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/75/213775/1
diff --git a/includes/diff/UnifiedDiffFormatter.php
b/includes/diff/UnifiedDiffFormatter.php
index 32a7605..5f3ad3d 100644
--- a/includes/diff/UnifiedDiffFormatter.php
+++ b/includes/diff/UnifiedDiffFormatter.php
@@ -38,6 +38,16 @@
/**
* @param string[] $lines
+ * @param string $prefix
+ */
+ protected function lines( $lines, $prefix = ' ' ) {
+ foreach ( $lines as $line ) {
+ echo "{$prefix}{$line}\n";
+ }
+ }
+
+ /**
+ * @param string[] $lines
*/
protected function added( $lines ) {
$this->lines( $lines, '+' );
--
To view, visit https://gerrit.wikimedia.org/r/213775
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bf1b8e6d1d5aceb2c3836548f492f7edebe5a12
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits