'diff_line',
'diff_hunk',
'diff_file',
- 'diff'
+ 'diff',
+ 'file_change'
);
require_once('./global.php');
$log['message_clean'] = nl2br(htmlspecialchars($log['message']));
+$files = $viewsvn->svn->common->construct_file_changes($log['files'], $repos, $high);
+
// ###################################################################
if ($high == 'HEAD')
// ###################################################################
+//echo('$template->flush("' . $template->fetch('diff') . '");');
eval('$template->flush("' . $template->fetch('diff') . '");');
/*=====================================================================*\
return null;
}
}
+
+ /**
+ * Prints the file changed list
+ *
+ * @access public
+ *
+ * @public array List of file changes
+ * @public string The repository
+ * @public integer Current revision
+ *
+ * @return string Processed HTML
+ */
+ function construct_file_changes($changes, $repos, $revision)
+ {
+ global $viewsvn;
+
+ $files = '';
+
+ foreach ($changes AS $file)
+ {
+ switch ($file['action'])
+ {
+ case 'A':
+ $class = 'file_add';
+ $tooltip = 'Added';
+ break;
+ case 'D':
+ $class = 'file_delete';
+ $tooltip = 'Deleted';
+ break;
+ case 'M':
+ $class = 'file_modify';
+ $tooltip = 'Modified';
+ break;
+ case 'R':
+ $class = 'file_replace';
+ $tooltip = 'Replaced';
+ break;
+ }
+
+ $show['from'] = (bool)$file['from'];
+
+ if ($file['from'])
+ {
+ $class = 'file_move';
+ $tooltip = 'Moved/Copied';
+ preg_match('#(.*):([0-9]+)#', $file['from'], $matches);
+ $link['from'] = $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $matches[2]), $repos . $matches[1]);
+ }
+
+ $link['file'] = $viewsvn->paths->out('view.php' . $viewsvn->paths->fetch_rev_str(false, $revision), $file['file']);
+
+ eval('$files .= "' . $viewsvn->template->fetch('file_change') . '";');
+ }
+
+ return $files;
+ }
}
/**
}
else if (preg_match('#^\s+([ADMR])\s(.*)#', $line, $matches))
{
+ if (preg_match('#(.*) \(from (.*?)\)$#', $matches[2], $amatches))
+ {
+ $matches[2] = $amatches[1];
+ }
+
$this->logs["$lastrev"]['files'][] = array(
'action' => $matches[1],
- 'file' => $matches[2]
+ 'file' => trim($matches[2]),
+ 'from' => (isset($amatches[2]) ? $amatches[2] : '')
);
}
else
<head>
$headinclude
<link rel="stylesheet" href="$viewsvn->path/templates/default/diff.css" media="screen" />
+ <link rel="stylesheet" href="$viewsvn->path/templates/default/file.css" media="screen" />
<title>Diff</title>
</head>
<div><strong>Date:</strong> $log[date] $log[timezone]</div>
<div><strong>Message:</strong> $log[message_clean]</div>
</div>
+<div class="subhead" style="border-width: 0px 1px 0px 1px">File Changes</div>
+<div class="content">
+$files
+</div>
<br />
--- /dev/null
+/*=====================================================================*\
+|| ###################################################################
+|| # ViewSVN [#]version[#]
+|| # Copyright ©2002-[#]year[#] Iris Studios, Inc.
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+.file_bit
+{
+ width: 12px;
+ height: 12px;
+
+ display: inline;
+ float: left;
+
+ border-color: rgb(153, 153, 153);
+ border-width: 1px;
+ border-style: solid;
+
+ margin-top: 1px;
+ margin-right: 5px;
+}
+
+.file_add
+{
+ background-color: rgb(187, 255, 187);
+}
+
+.file_modify
+{
+ background-color: rgb(255, 221, 136);
+}
+
+.file_delete
+{
+ background-color: rgb(255, 136, 136);
+}
+
+.file_move
+{
+ background-color: rgb(136, 136, 255);
+}
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
\ No newline at end of file
--- /dev/null
+ <div><div class="file_bit + $class" title="$tooltip"></div> <a href="$viewsvn->path/$link[file]">$file[file]</a> <if condition="$show['from']"><em>(from <a href="$viewsvn->path/$link[from]">$file[from]</a>)</em></if></div>