|
From: Meik S. <acy...@ph...> - 2009-09-04 14:50:53
|
Author: acydburn
Date: Fri Sep 4 15:50:05 2009
New Revision: 10102
Log:
phpBB updater now skips sole whitespace changes. This reduces the chance of conflicts tremendously.
Modified:
branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
branches/phpBB-3_0_0/phpBB/includes/diff/engine.php
Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original)
--- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Fri Sep 4 15:50:05 2009
***************
*** 240,245 ****
--- 240,246 ----
<li>[Change] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)</li>
<li>[Change] Resize oversized Topic icons (Bug #44415)</li>
<li>[Change] Banned IPs are now sorted (Bug #43045 - Patch by DavidIQ)</li>
+ <li>[Change] phpBB updater now skips sole whitespace changes. This reduces the chance of conflicts tremendously.</li>
<li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li>
<li>[Feature] Backported 3.2 captcha plugins.
<ul>
Modified: branches/phpBB-3_0_0/phpBB/includes/diff/engine.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/diff/engine.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/diff/engine.php Fri Sep 4 15:50:05 2009
***************
*** 49,54 ****
--- 49,56 ----
*/
class diff_engine
{
+ var $skip_whitespace_changes = true;
+
function diff(&$from_lines, &$to_lines, $preserve_cr = true)
{
// Remove empty lines...
***************
*** 176,181 ****
--- 178,197 ----
$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);
|