[Codestriker-commits] CVS update: codestriker/lib/Codestriker/Action ViewTopicFile.pm
Brought to you by:
sits
From: <si...@us...> - 2008-08-07 23:34:01
|
User: sits Date: 08/08/07 16:34:01 Modified: . CHANGELOG lib/Codestriker/Action ViewTopicFile.pm Log: * Allow the Parallel links to work for new files and display them appropriately. Index: CHANGELOG =================================================================== RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v retrieving revision 1.255 retrieving revision 1.256 diff -u -r1.255 -r1.256 --- CHANGELOG 7 Aug 2008 06:48:12 -0000 1.255 +++ CHANGELOG 7 Aug 2008 23:34:00 -0000 1.256 @@ -52,7 +52,10 @@ * In the create topic email, show the URL to the associated bug records if $bugtracker is defined in codestriker.conf rather than just the bug - IDs. + IDs. + +* Allow the Parallel links to work for new files and display them + appropriately. Version 1.9.5 Index: ViewTopicFile.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicFile.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ViewTopicFile.pm 19 Jun 2008 03:33:51 -0000 1.16 +++ ViewTopicFile.pm 7 Aug 2008 23:34:00 -0000 1.17 @@ -57,10 +57,18 @@ # Load the appropriate original form of this file into memory. my @filedata; - if (!$repository->retrieve($filename, $revision, \@filedata)) { - $http_response->error("Couldn't get repository data for $filename " . - "$revision: $!"); + if ($deltas[0]->{only_delta_in_file} && + $deltas[0]->{revision} == $Codestriker::ADDED_REVISION) { + # New file, the data is contained entirely in the delta. + $deltas[0]->{new_file} = 1; + @filedata = (); } + else { + if (!$repository->retrieve($filename, $revision, \@filedata)) { + $http_response->error("Couldn't get repository data for $filename " . + "$revision: $!"); + } + } # Output the new file, with the deltas applied. my $title; @@ -90,7 +98,8 @@ $merged_delta->{binary} = $delta->{binary}; $merged_delta->{filenumber} = $delta->{filenumber}; $merged_delta->{repmatch} = $delta->{repmatch}; - $merged_delta->{old_linenumber} = 1; + $merged_delta->{new_file} = $delta->{new_file}; + $merged_delta->{old_linenumber} = $delta->{new_file} ? 0 : 1; $merged_delta->{new_linenumber} = 1; $merged_delta->{only_delta_in_file} = 1; } |