diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 1210ca63..2c562dbf 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -25,9 +25,16 @@ class SubversionModel extends Model $str = @svn_cat ($url, $rev); if ($str === FALSE) return FALSE; + $log = @svn_log ($url, + $fileinfo['created_rev'], + $fileinfo['created_rev'], + 1, SVN_DISCOVER_CHANGED_PATHS); + if ($log === FALSE) return FALSE; + $fileinfo['fullpath'] = substr ( $info[0]['url'], strlen($info[0]['repos'])); $fileinfo['content'] = $str; + $fileinfo['logmsg'] = (count($log) > 0)? $log[0]['msg']: ''; return $fileinfo; } else if ($info[0]['kind'] == SVN_NODE_DIR) @@ -35,6 +42,12 @@ class SubversionModel extends Model $list = @svn_ls ($url, $rev, FALSE, TRUE); if ($list === FALSE) return FALSE; + $log = @svn_log ($url, + $fileinfo['created_rev'], + $fileinfo['created_rev'], + 1, SVN_DISCOVER_CHANGED_PATHS); + if ($log === FALSE) return FALSE; + $fileinfo['fullpath'] = substr ( $info[0]['url'], strlen($info[0]['repos'])); $fileinfo['name'] = $info[0]['path']; @@ -43,7 +56,7 @@ class SubversionModel extends Model $fileinfo['created_rev'] = $info[0]['revision']; $fileinfo['last_author'] = $info[0]['last_changed_rev']; $fileinfo['content'] = $list; - + $fileinfo['logmsg'] = (count($log) > 0)? $log[0]['msg']: ''; return $fileinfo; } @@ -68,9 +81,16 @@ class SubversionModel extends Model $str = @svn_blame ($url, $rev); if ($str === FALSE) return FALSE; + $log = @svn_log ($url, + $fileinfo['created_rev'], + $fileinfo['created_rev'], + 1, SVN_DISCOVER_CHANGED_PATHS); + if ($log === FALSE) return FALSE; + $fileinfo['fullpath'] = substr ( $info[0]['url'], strlen($info[0]['repos'])); $fileinfo['content'] = $str; + $fileinfo['logmsg'] = (count($log) > 0)? $log[0]['msg']: ''; return $fileinfo; } diff --git a/codepot/src/codepot/views/source_blame.php b/codepot/src/codepot/views/source_blame.php index 16c5b83e..d874181b 100644 --- a/codepot/src/codepot/views/source_blame.php +++ b/codepot/src/codepot/views/source_blame.php @@ -104,68 +104,89 @@ print anchor ("source/history/{$project->id}/{$xpar}", $this->lang->line('Histor ?> -
converter->AsciiTohex ($headpath); - $rev_padded = anchor ("/source/blame/{$project->id}/{$xpar}/{$rev}", $rev_padded); + $line = $content[$i]; + $lineno_padded = str_pad ($line['line_no'], 6, ' ', STR_PAD_LEFT); + + if ($line['rev'] != $rev) + { + $rev = $line['rev']; + $rev_padded = str_pad ($rev, 6, ' ', STR_PAD_LEFT); + + $xpar = $this->converter->AsciiTohex ($headpath); + $rev_padded = anchor ("/source/blame/{$project->id}/{$xpar}/{$rev}", $rev_padded); + } + else + { + $rev_padded = str_pad (' ', 6, ' ', STR_PAD_LEFT); + } + + if ($line['author'] != $author) + { + $author = $line['author']; + $author_padded = str_pad ($author, 8, ' ', STR_PAD_RIGHT); + $author_padded = substr($author_padded, 0, 8); + } + else + { + $author_padded = str_pad (' ', 8, ' ', STR_PAD_RIGHT); + } + + print "{$rev_padded}"; + print "{$author_padded}"; + print "{$lineno_padded}"; + print htmlspecialchars ($line['line']); + print "\n"; } - else - { - $rev_padded = str_pad (' ', 6, ' ', STR_PAD_LEFT); - } - - if ($line['author'] != $author) - { - $author = $line['author']; - $author_padded = str_pad ($author, 8, ' ', STR_PAD_RIGHT); - $author_padded = substr($author_padded, 0, 8); - } - else - { - $author_padded = str_pad (' ', 8, ' ', STR_PAD_RIGHT); - } - - print "{$rev_padded}"; - print "{$author_padded}"; - print "{$lineno_padded}"; - print htmlspecialchars ($line['line']); - print "\n"; -} ?>-
+= $file['logmsg'] ?> ++
-akdjflosjfkdsajflkdsj -aslkfdjdsalkjfs -alkjfdlkajf + - -sadkfjsalfjskjdslkfsaj -+ +
+= $file['logmsg'] ?> ++