*** /home/achiang/old.Store.pm Sat Aug 9 01:16:21 2003
--- Store.pm Sat Aug 9 01:30:25 2003
***************
*** 328,339 ****
# =========================
! # rdiff: $text = &TWiki::Store::getRevisionDiff( $webName, $topic, "1.$r2", "1.$r1" );
sub getRevisionDiff
{
! my( $web, $topic, $rev1, $rev2 ) = @_;
! my $rcs = _getTopicHandler( $web, $topic );
my $r1 = substr( $rev1, 2 );
my $r2 = substr( $rev2, 2 );
my( $error, $diff ) = $rcs->revisionDiff( $r1, $r2 );
--- 328,339 ----
# =========================
! # rdiff: $text = &TWiki::Store::getRevisionDiff( $webName, $topic, $attachment, "1.$r2", "1.$r1" );
sub getRevisionDiff
{
! my( $web, $topic, $attachment, $rev1, $rev2 ) = @_;
! my $rcs = _getTopicHandler( $web, $topic, $attachment );
my $r1 = substr( $rev1, 2 );
my $r2 = substr( $rev2, 2 );
my( $error, $diff ) = $rcs->revisionDiff( $r1, $r2 );
***************
*** 744,754 ****
# =========================
sub topicExists
{
! my( $theWeb, $theTopic ) = @_;
( $theWeb, $theTopic ) = normalizeWebTopicName( $theWeb, $theTopic );
! return -e "$TWiki::dataDir/$theWeb/$theTopic.txt";
}
# =========================
# Try and get from meta information in topic, if this can't be done then use RCS
# Note there is no "1." prefix to this data
--- 744,760 ----
# =========================
sub topicExists
{
! my( $theWeb, $theTopic, $theFile ) = @_;
( $theWeb, $theTopic ) = normalizeWebTopicName( $theWeb, $theTopic );
!
! if ( $theFile eq "" ) {
! return -e "$TWiki::dataDir/$theWeb/$theTopic.txt";
! } else {
! return -e "$TWiki::pubDir/$theWeb/$theTopic/$theFile";
! }
}
+
# =========================
# Try and get from meta information in topic, if this can't be done then use RCS
# Note there is no "1." prefix to this data
*** /home/achiang/old.attach Sat Aug 9 01:15:58 2003
--- attach Sat Aug 9 01:17:28 2003
***************
*** 42,59 ****
my $found = 0;
! my $result = "\n| *Version:* | *Action:* | *Date:* | *Who:* | *Comment:* |\n";
for( my $version = $maxRevNum; $version >= 1; $version-- ) {
my $rev = "1.$version";
my( $date, $userName, $dummy, $comment ) =
TWiki::Store::getRevisionInfo( $web, $topic, $rev, "TWiki date", $attachment );
my $wikiUserName = &TWiki::userToWikiName( $userName );
my $viewAction = "view";
! $result .= "| 1.$version | $viewAction | $date | $wikiUserName | $comment |\n";
}
$result = "$result";
--- 42,63 ----
my $found = 0;
! my $result = "\n| *Version:* | *Action:* | *Action:* | *Date:* | *Who:* | *Comment:* |\n";
for( my $version = $maxRevNum; $version >= 1; $version-- ) {
my $rev = "1.$version";
+ my $lastRev = "1." . $version-.1;
my( $date, $userName, $dummy, $comment ) =
TWiki::Store::getRevisionInfo( $web, $topic, $rev, "TWiki date", $attachment );
my $wikiUserName = &TWiki::userToWikiName( $userName );
my $viewAction = "view";
!
! my $diffAction = "diff against $lastRev";
!
! $result .= "| 1.$version | $viewAction | $diffAction | $date | $wikiUserName | $comment |\n";
}
$result = "$result";
*** /home/achiang/old.rdiff Sat Aug 9 01:16:02 2003
--- rdiff Sat Aug 9 01:14:08 2003
***************
*** 128,133 ****
--- 128,134 ----
my $tmpl = "", $text = "", $diff = "";
my $rev1 = $query->param( "rev1" );
my $rev2 = $query->param( "rev2" );
+ my $attachment = $query->param( "filename" );
my $maxrev= 1;
my $i = $maxrev, $j = $maxrev;
my $revTitle1 = "", $revTitle2 = "";
***************
*** 147,155 ****
my( $before, $difftmpl, $after) = split( /%REPEAT%/, $tmpl);
! my $topicExists = &TWiki::Store::topicExists( $webName, $topic );
if( $topicExists ) {
! $maxrev = &TWiki::Store::getRevisionNumber( $webName, $topic );
$maxrev =~ s/r?1\.//go; # cut 'r' and major
if( ! $rev1 ) { $rev1 = 0; }
if( ! $rev2 ) { $rev2 = 0; }
--- 148,156 ----
my( $before, $difftmpl, $after) = split( /%REPEAT%/, $tmpl);
! my $topicExists = &TWiki::Store::topicExists( $webName, $topic, $attachment );
if( $topicExists ) {
! $maxrev = &TWiki::Store::getRevisionNumber($webName, $topic );
$maxrev =~ s/r?1\.//go; # cut 'r' and major
if( ! $rev1 ) { $rev1 = 0; }
if( ! $rev2 ) { $rev2 = 0; }
***************
*** 201,207 ****
$diff =~ s/%REVTITLE1%/r1\.$r1/go;
$rInfo = getRevInfo( $webName, $r1, $topic, 1 );
$diff =~ s/%REVINFO1%/$rInfo/go;
! $text = &TWiki::Store::getRevisionDiff( $webName, $topic, "1.$r2", "1.$r1" );
$text = renderRevisionDiff( $text, $topic );
$diff =~ s/%TEXT%/$text/go;
$diff =~ s|( ?) **nop/*>\n?|$1|gois; # remove tags (PTh 06 Nov 2000)
--- 202,208 ----
$diff =~ s/%REVTITLE1%/r1\.$r1/go;
$rInfo = getRevInfo( $webName, $r1, $topic, 1 );
$diff =~ s/%REVINFO1%/$rInfo/go;
! $text = &TWiki::Store::getRevisionDiff( $webName, $topic, $attachment, "1.$r2", "1.$r1" );
$text = renderRevisionDiff( $text, $topic );
$diff =~ s/%TEXT%/$text/go;
$diff =~ s|( ?) **nop/*>\n?|$1|gois; # remove tags (PTh 06 Nov 2000)
***************
*** 266,269 ****
--- 267,271 ----
$after =~ s|( ?) **nop/*>\n?|$1|gois; # remove tags (PTh 06 Nov 2000)
print $after;
+
}