Skip to content
Browse files

SourceWebSVN plugin: Allow viewing removed files

  • Loading branch information...
1 parent deba255 commit c11a010d491ec7f80fd4b842dc8770098af2fc44 @jeckyhl jeckyhl committed Feb 28, 2013
Showing with 8 additions and 5 deletions.
  1. +8 −5 SourceWebSVN/SourceWebSVN.php
View
13 SourceWebSVN/SourceWebSVN.php
@@ -131,13 +131,16 @@ public function url_changeset( $p_repo, $p_changeset ) {
}
public function url_file( $p_repo, $p_changeset, $p_file ) {
- if ( $p_file->action == 'rm' ) {
- return '';
- }
+
+ # if the file has been removed, it doesn't exists in current revision
+ # so we generate a link to (current revision - 1)
+ $t_revision = ($p_file->action == 'rm')
+ ? $p_changeset->revision - 1
+ : $p_changeset->revision;
$t_opts = array();
- $t_opts['rev'] = $p_changeset->revision;
- $t_opts['peg'] = $p_changeset->revision;
+ $t_opts['rev'] = $t_revision;
+ $t_opts['peg'] = $t_revision;
return $this->url_base( $p_repo, 'filedetails', $p_file->filename, $t_opts );
}

0 comments on commit c11a010

Please sign in to comment.
Something went wrong with that request. Please try again.