]>
src.bluestatic.org Git - viewsvn.git/blob - diff.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # ViewSVN [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 $fetchtemplates = array(
20 require_once('./global.php');
22 $navbar = $viewsvn->paths
->construct_breadcrumb($path, false);
24 // ###################################################################
26 $link['log'] = $viewsvn->paths
->out('log.php' . $viewsvn->paths
->fetch_rev_str(), $path);
28 // ###################################################################
30 $revs = $viewsvn->paths
->fetch_rev_num(true);
31 $high = $revs['high'];
36 $high = $viewsvn->svn
->common
->fetch_head_rev($path);
41 $low = $viewsvn->svn
->common
->fetch_prev_rev($path, $high);
44 $diff = new SVNDiff($repos, $relpath, $low, $high);
46 $isdir = (bool)$viewsvn->svn
->common
->isdir($path);
50 foreach ($diff->fetch() AS $filename => $file)
54 foreach ($file AS $hunk)
57 foreach ($hunk AS $key => $line)
59 $show['hunk'] = false;
60 if ($key == 'hunk' AND isset($line['old']))
62 $filepath = ($isdir ? $path . $filename : $path);
63 $rlow = $viewsvn->paths
->out('view.php' . $viewsvn->paths
->fetch_rev_str(false, $low), $filepath);
64 $rhigh = $viewsvn->paths
->out('view.php' . $viewsvn->paths
->fetch_rev_str(false, $high), $filepath);
69 if ($line['act'] == '+')
71 $class = 'diff_add_bit';
73 else if ($line['act'] == '-')
75 $class = 'diff_del_bit';
82 $line['line_clean'] = $viewsvn->svn
->format($line['line']);
85 eval('$lines .= "' . $template->fetch('diff_line') . '";');
87 eval('$hunktpl .= "' . $template->fetch('diff_hunk') . '";');
90 eval('$changes .= "' . $template->fetch('diff_file') . '";');
93 // ###################################################################
95 eval('$template->flush("' . $template->fetch('diff') . '");');
97 /*=====================================================================*\
98 || ###################################################################
101 || ###################################################################
102 \*=====================================================================*/