aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-09-04 14:50:05 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-09-04 14:50:05 +0000
commit186abf0798463d2bb9e37117ec7d451efd37b7a1 (patch)
treea65dcfbfcfe014e464c29d7d7bd0fea7cf6ace42 /phpBB/includes
parentba2fb956de1affbd924c07b020385413077bbe8a (diff)
downloadforums-186abf0798463d2bb9e37117ec7d451efd37b7a1.tar
forums-186abf0798463d2bb9e37117ec7d451efd37b7a1.tar.gz
forums-186abf0798463d2bb9e37117ec7d451efd37b7a1.tar.bz2
forums-186abf0798463d2bb9e37117ec7d451efd37b7a1.tar.xz
forums-186abf0798463d2bb9e37117ec7d451efd37b7a1.zip
phpBB updater now skips sole whitespace changes. This reduces the chance of conflicts tremendously.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10102 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/diff/engine.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php
index eb0dcce395..e9f0e41b75 100644
--- a/phpBB/includes/diff/engine.php
+++ b/phpBB/includes/diff/engine.php
@@ -49,6 +49,8 @@ if (!defined('IN_PHPBB'))
*/
class diff_engine
{
+ var $skip_whitespace_changes = true;
+
function diff(&$from_lines, &$to_lines, $preserve_cr = true)
{
// Remove empty lines...
@@ -176,6 +178,20 @@ class diff_engine
$add[] = $to_lines[$yi++];
}
+ // Here we are a bit naughty. Naughty Boy... Naughty Boy...
+ // We check if delete and add is filled and only consist of one item
+ if ($this->skip_whitespace_changes && sizeof($delete) == 1 && sizeof($add) == 1)
+ {
+ // Now we simply trim the string and see if the lines are identical
+ // If they are identical we do not need to take them into account for the merge (less conflicts in phpBB)
+ if (trim($delete[0]) === trim($add[0]))
+ {
+ // This line ensures the line found here is correctly copied later (remember: we naughty boys like loops)
+ $xi--; $yi--; $this->xchanged[$xi] = $this->ychanged[$yi] = false;
+ $delete = $add = array();
+ }
+ }
+
if ($delete && $add)
{
$edits[] = new diff_op_change($delete, $add);