]>
src.bluestatic.org Git - viewsvn.git/blob - diff.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 $fetchtemplates = array(
29 require_once('./global.php');
31 $navbar = $viewsvn->paths
->construct_breadcrumb($path, false);
33 // ###################################################################
35 $link['log'] = $viewsvn->paths
->out('log.php' . $viewsvn->paths
->fetch_rev_str(), $path);
37 // ###################################################################
39 $revs = $viewsvn->paths
->fetch_rev_num(true);
40 $high = $revs['high'];
45 $high = $viewsvn->svn
->common
->fetch_head_rev($path);
50 $low = $viewsvn->svn
->common
->fetch_prev_rev($path, $high);
53 $diff = new SVNDiff($repos, $relpath, $low, $high);
55 $isdir = (bool)$viewsvn->svn
->common
->isdir($path);
59 foreach ($diff->fetch() AS $filename => $file)
63 foreach ($file AS $hunk)
66 foreach ($hunk AS $key => $line)
68 $show['hunk'] = false;
69 if ($key == 'hunk' AND isset($line['old']))
71 $filepath = ($isdir ? $path . $filename : $path);
72 $rlow = $viewsvn->paths
->out('view.php' . $viewsvn->paths
->fetch_rev_str(false, $low), $filepath);
73 $rhigh = $viewsvn->paths
->out('view.php' . $viewsvn->paths
->fetch_rev_str(false, $high), $filepath);
78 if ($line['act'] == '+')
82 else if ($line['act'] == '-')
91 $line['line_clean'] = $viewsvn->svn
->format($line['line']);
94 eval('$lines .= "' . $template->fetch('diff_line') . '";');
96 eval('$hunktpl .= "' . $template->fetch('diff_hunk') . '";');
99 eval('$changes .= "' . $template->fetch('diff_file') . '";');
102 // ###################################################################
104 eval('$template->flush("' . $template->fetch('diff') . '");');
106 /*=====================================================================*\
107 || ###################################################################
110 || ###################################################################
111 \*=====================================================================*/