Skip to content

Commit

Permalink
Porting fixes from SourceWebSVN to SourceSFSVN
Browse files Browse the repository at this point in the history
This follows discussion on dregad@deba255#commitcomment-2713308

Changesets deba255 and
c11a010 for SourceWebSVN apply mutatis
mutandis to SourceSFSVN.

Fixes #52
  • Loading branch information
dregad committed Mar 5, 2013
2 parents 2e26ad6 + df68930 commit 287e02a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions SourceSFSVN/SourceSFSVN.php
Expand Up @@ -48,15 +48,17 @@ public function url_changeset( $p_repo, $p_changeset ) {
} }


public function url_file( $p_repo, $p_changeset, $p_file ) { public function url_file( $p_repo, $p_changeset, $p_file ) {
if ( $p_file->action == 'D' ) { # if the file has been removed, it doesn't exist in current revision
return ''; # so we generate a link to (current revision - 1)
} $t_revision = ($p_file->action == 'rm')
? $p_changeset->revision - 1
: $p_changeset->revision;
return $this->sf_url( $p_repo ) . urlencode( $p_file->filename ) . return $this->sf_url( $p_repo ) . urlencode( $p_file->filename ) .
'?view=markup&pathrev=' . urlencode( $p_changeset->revision ); '?view=markup&pathrev=' . urlencode( $t_revision );
} }


public function url_diff( $p_repo, $p_changeset, $p_file ) { public function url_diff( $p_repo, $p_changeset, $p_file ) {
if ( $p_file->action == 'D' || $p_file->action == 'A' ) { if ( $p_file->action == 'rm' || $p_file->action == 'add' ) {
return ''; return '';
} }
$t_diff = '?r1=' . urlencode( $p_changeset->revision ) . '&r2=' . urlencode( $p_changeset->revision - 1 ); $t_diff = '?r1=' . urlencode( $p_changeset->revision ) . '&r2=' . urlencode( $p_changeset->revision - 1 );
Expand Down

0 comments on commit 287e02a

Please sign in to comment.