diff --git a/codepot/src/codepot/helpers/codepot_helper.php b/codepot/src/codepot/helpers/codepot_helper.php index 9a98eaa6..f2e0b3ee 100644 --- a/codepot/src/codepot/helpers/codepot_helper.php +++ b/codepot/src/codepot/helpers/codepot_helper.php @@ -370,10 +370,12 @@ if (!function_exists ('codepot_get_fa_file_type')) 'png' => 'image', 'pdf' => 'pdf', + + 'htm' => 'text', + 'html' => 'text', 'txt' => 'text', 'wiki' => 'text', - 'htm' => 'html', - 'html' => 'html', + 'xml' => 'text', 'doc' => 'word', 'docx' => 'word', diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index f32343bb..74f2ccc3 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -192,6 +192,7 @@ class SubversionModel extends Model // // Try to get the history from the head revision down. + // regardless of the given revision. // $info = @svn_info ($url, FALSE, $rev); if ($info === FALSE || count($info) != 1) @@ -233,8 +234,11 @@ class SubversionModel extends Model $fileinfo['name'] = $info[0]['path']; $fileinfo['type'] = 'dir'; $fileinfo['size'] = 0; - $fileinfo['created_rev'] = $info[0]['revision']; - $fileinfo['last_author'] = $info[0]['last_changed_rev']; + if (array_key_exists('last_changed_rev', $info[0])) + $fileinfo['created_rev'] = $info[0]['last_changed_rev']; + else + $fileinfo['created_rev'] = $info[0]['revision']; + $fileinfo['last_author'] = $info[0]['last_changed_author']; } else return FALSE; @@ -259,11 +263,9 @@ class SubversionModel extends Model $info = @svn_info ($url, FALSE, $rev); if ($info === FALSE || count($info) != 1) return FALSE; + $actual_rev = $rev; if ($info[0]['kind'] == SVN_NODE_FILE) { - // do not revision history this for a file. - return FALSE; - /* $lsinfo = @svn_ls ($url, $rev, FALSE, TRUE); if ($lsinfo === FALSE) return FALSE; @@ -271,7 +273,8 @@ class SubversionModel extends Model $fileinfo = $lsinfo[$info[0]['path']]; if (!array_key_exists ('fullpath', $fileinfo)) $fileinfo['fullpath'] = $info[0]['path']; - */ + + $actual_rev = $fileinfo['created_rev']; } else if ($info[0]['kind'] == SVN_NODE_DIR) @@ -281,12 +284,17 @@ class SubversionModel extends Model $fileinfo['name'] = $info[0]['path']; $fileinfo['type'] = 'dir'; $fileinfo['size'] = 0; - $fileinfo['created_rev'] = $info[0]['revision']; - $fileinfo['last_author'] = $info[0]['last_changed_rev']; + if (array_key_exists('last_changed_rev', $info[0])) + $fileinfo['created_rev'] = $info[0]['last_changed_rev']; + else + $fileinfo['created_rev'] = $info[0]['revision']; + $fileinfo['last_author'] = $info[0]['last_changed_author']; + + $actual_rev = $fileinfo['created_rev']; } else return FALSE; - $log = @svn_log ($url, $rev, $rev, 1, SVN_DISCOVER_CHANGED_PATHS); + $log = @svn_log ($url, $actual_rev, $actual_rev, 1, SVN_DISCOVER_CHANGED_PATHS); if ($log === FALSE) return FALSE; if (count($log) != 1) return FALSE; diff --git a/codepot/src/codepot/views/code_blame.php b/codepot/src/codepot/views/code_blame.php index cb6a2d69..31de5e1f 100644 --- a/codepot/src/codepot/views/code_blame.php +++ b/codepot/src/codepot/views/code_blame.php @@ -144,6 +144,10 @@ $this->load->view ( diff --git a/codepot/src/codepot/views/code_diff.php b/codepot/src/codepot/views/code_diff.php index f47fe881..53b0da93 100644 --- a/codepot/src/codepot/views/code_diff.php +++ b/codepot/src/codepot/views/code_diff.php @@ -106,7 +106,7 @@ $this->load->view ( print ' | '; print anchor ( "code/blame/{$project->id}/{$xpar}{$revreq}", - $this->lang->line('Blame')); + ' ' . $this->lang->line('Blame')); print ' | '; if (!$fullview) @@ -125,19 +125,16 @@ $this->load->view ( print ' | '; + $history_anchor_text = ' ' . $this->lang->line('History'); if ($revision1 > 0) { if ($xpar == '') $revtrailer = $revreqroot; else $revtrailer = "/{$xpar}{$revreq}"; - print anchor ( - "code/history/{$project->id}{$revtrailer}", - $this->lang->line('History')); + print anchor ("code/history/{$project->id}{$revtrailer}", $history_anchor_text); } else { - print anchor ( - "code/history/{$project->id}/{$xpar}", - $this->lang->line('History')); + print anchor ("code/history/{$project->id}/{$xpar}", $history_anchor_text); } ?> diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index 5fe8c6b0..fb235a67 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -158,6 +158,10 @@ $this->load->view ( converter->AsciiToHex ($headpath); + $blame_anchor_text = ' ' . $this->lang->line('Blame'); + $history_anchor_text = ' ' . $this->lang->line('History'); + $download_anchor_text = ' ' . $this->lang->line('Download'); + if ($file['created_rev'] != $file['head_rev']) { print anchor ( @@ -166,39 +170,26 @@ $this->load->view ( print ' | '; } - print anchor ( - "code/blame/{$project->id}/${xpar}{$revreq}", - $this->lang->line('Blame')); + print anchor ("code/blame/{$project->id}/${xpar}{$revreq}", $blame_anchor_text); print ' | '; - print anchor ( - "code/diff/{$project->id}/{$xpar}{$revreq}", - $this->lang->line('Difference')); + print anchor ("code/diff/{$project->id}/{$xpar}{$revreq}", $this->lang->line('Difference')); print ' | '; - print anchor ( - "code/fulldiff/{$project->id}/{$xpar}{$revreq}", - $this->lang->line('Full Difference')); + print anchor ("code/fulldiff/{$project->id}/{$xpar}{$revreq}", $this->lang->line('Full Difference')); print ' | '; - if ($revision > 0) { if ($xpar == '') $revtrailer = $revreqroot; else $revtrailer = "/{$xpar}{$revreq}"; - print anchor ( - "code/history/{$project->id}{$revtrailer}", - $this->lang->line('History')); + print anchor ("code/history/{$project->id}{$revtrailer}", $history_anchor_text); } else { - print anchor ( - "code/history/{$project->id}/{$xpar}", - $this->lang->line('History')); + print anchor ("code/history/{$project->id}/{$xpar}", $history_anchor_text); } print ' | '; - print anchor ( - "code/fetch/{$project->id}/${xpar}{$revreq}", - $this->lang->line('Download')); + print anchor ("code/fetch/{$project->id}/${xpar}{$revreq}", $download_anchor_text); print ' | '; print anchor ( diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index 3814fe3b..3612830a 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -455,24 +455,29 @@ $this->load->view ( print ' | '; } + $history_anchor_text = ' ' . $this->lang->line('History'); + $download_anchor_text = ' ' . $this->lang->line('Download'); + if ($revision > 0) { if ($xpar == '') $revtrailer = $revreqroot; else $revtrailer = "/{$xpar}{$revreq}"; - print anchor ("code/history/{$project->id}{$revtrailer}", $this->lang->line('History')); + print anchor ("code/history/{$project->id}{$revtrailer}", $history_anchor_text); } else - print anchor ("code/history/{$project->id}/{$xpar}", $this->lang->line('History')); + { + print anchor ("code/history/{$project->id}/{$xpar}", $history_anchor_text); + } print ' | '; - print anchor ( - "code/fetch/{$project->id}/${xpar}{$revreq}", - $this->lang->line('Download')); + print anchor ("code/fetch/{$project->id}/${xpar}{$revreq}", $download_anchor_text); print ''; usort ($file['content'], 'comp_files'); + $blame_anchor_text = ' ' . $this->lang->line('Blame'); + print ''; print ''; print ''; @@ -517,6 +522,7 @@ $this->load->view ( print ''; print ''; print ''; + print ''; print ''; } else @@ -546,9 +552,7 @@ $this->load->view ( print ''; print ''; print ''; + print ''; - } - else if ($file['type'] == 'dir') - { - print ''; } + print ''; print ''; diff --git a/codepot/src/codepot/views/code_revision.php b/codepot/src/codepot/views/code_revision.php index 0a754841..e9c0e0a7 100644 --- a/codepot/src/codepot/views/code_revision.php +++ b/codepot/src/codepot/views/code_revision.php @@ -6,6 +6,7 @@ + @@ -309,6 +310,15 @@ $history = $file['history']; if ($headpath != $file['fullpath']) { + // this comparsion doesn't work well for a file. + // $file['fullpath'] for a file doesn't include the directory. + // is this a bug of peclsvn? never mind. it's ok to show the file name again. + // + // [created_rev] => 322 + // [name] => subversionmodel.php + // [type] => file + // [fullpath] => subversionmodel.php + print ' - '; print htmlspecialchars($file['fullpath']); } @@ -317,6 +327,8 @@ $history = $file['history'];
id}/${xpar}/{$prev_revision}", '<<'); + print anchor ("code/revision/{$project->id}/${xpar}/{$prev_revision}", ''); print ' '; printf ('%s %s', $this->lang->line('Revision'), $history['rev']); @@ -354,10 +364,11 @@ $history = $file['history']; } print ' '; - print anchor ("code/revision/{$project->id}/${xpar}/{$next_revision}", '>>'); + print anchor ("code/revision/{$project->id}/${xpar}/{$next_revision}", ''); if ($can_edit) { + print ' '; print ''; print anchor ("#", $this->lang->line('Tag'), array ('id' => 'code_revision_tag_button')); print ''; diff --git a/codepot/src/codepot/views/file_home.php b/codepot/src/codepot/views/file_home.php index 2df6c293..da5dbdb1 100644 --- a/codepot/src/codepot/views/file_home.php +++ b/codepot/src/codepot/views/file_home.php @@ -8,6 +8,7 @@ + @@ -98,6 +99,8 @@ else usort ($files, 'comp_files'); + $download_anchor_text = ' ' . $this->lang->line('Download'); + print '
' . $this->lang->line('Name') . '
'; - print anchor ( - "code/blame/{$project->id}/{$hexpath}{$revreq}", - $this->lang->line('Blame')); + print anchor ("code/blame/{$project->id}/{$hexpath}{$revreq}", $blame_anchor_text); print ''; print anchor ( diff --git a/codepot/src/codepot/views/code_history.php b/codepot/src/codepot/views/code_history.php index 0d995ac9..5d9be568 100644 --- a/codepot/src/codepot/views/code_history.php +++ b/codepot/src/codepot/views/code_history.php @@ -6,6 +6,7 @@ + @@ -152,23 +153,19 @@ $this->load->view ( print ''; print ''; + print anchor ("code/revision/{$project->id}/{$xfullpath}/{$h['rev']}", + $this->lang->line('Details')); if ($file['type'] == 'file') { - print ''; + print ' | '; print anchor ("code/blame/{$project->id}/{$xfullpath}/{$h['rev']}", - $this->lang->line('Blame')); - print ' '; + ' ' . $this->lang->line('Blame')); + print ' | '; print anchor ("code/diff/{$project->id}/{$xfullpath}/{$h['rev']}", $this->lang->line('Difference')); - print ''; - print anchor ("code/revision/{$project->id}/{$xfullpath}/{$h['rev']}", - $this->lang->line('Details')); - print '
'; print ''; print ''; @@ -132,7 +135,7 @@ else print $file->md5sum; print ''; print ''; print ''; } diff --git a/codepot/src/codepot/views/file_show.php b/codepot/src/codepot/views/file_show.php index 32334620..a20bd20a 100644 --- a/codepot/src/codepot/views/file_show.php +++ b/codepot/src/codepot/views/file_show.php @@ -6,6 +6,7 @@ + @@ -103,7 +104,10 @@ $this->load->view (
name)?>
- id}/". $this->converter->AsciiToHex($file->name), $this->lang->line('Download')) ?> + ' . $this->lang->line('Download'); + print anchor ("file/get/{$project->id}/". $this->converter->AsciiToHex($file->name), $download_anchor_text); + ?> | lang->line('Metadata')?>
' . $this->lang->line('Tag') . ''; - print anchor ("file/get/{$project->id}/{$hexname}", $this->lang->line('Download')); + print anchor ("file/get/{$project->id}/{$hexname}", $download_anchor_text); print '