Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Porting fixes from SourceWebSVN to SourceSFSVN

This follows discussion on dregad@deba255#commitcomment-2713308

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

Fixes #52
  • Loading branch information...
commit 287e02ad413582b3801f6c8f1ec495d2e8f65c73 2 parents 2e26ad6 + df68930
@dregad dregad authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 SourceSFSVN/SourceSFSVN.php
View
12 SourceSFSVN/SourceSFSVN.php
@@ -48,15 +48,17 @@ public function url_changeset( $p_repo, $p_changeset ) {
}
public function url_file( $p_repo, $p_changeset, $p_file ) {
- if ( $p_file->action == 'D' ) {
- return '';
- }
+ # if the file has been removed, it doesn't exist 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;
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 ) {
- if ( $p_file->action == 'D' || $p_file->action == 'A' ) {
+ if ( $p_file->action == 'rm' || $p_file->action == 'add' ) {
return '';
}
$t_diff = '?r1=' . urlencode( $p_changeset->revision ) . '&r2=' . urlencode( $p_changeset->revision - 1 );
Please sign in to comment.
Something went wrong with that request. Please try again.