Skip to content

Commit

Permalink
Item10311: Perltidy
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@10765 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Feb 22, 2011
1 parent df34875 commit 5db15bd
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions core/lib/Foswiki/UI/Manage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ sub _action_editSettings {
my $name = $field->{name};
my $value = $field->{value};
$settings .= ' * '
. ( ( defined($field->{type}) and $field->{type} eq 'Local' ) ? 'Local' : 'Set' ) . ' '
. ( ( defined( $field->{type} ) and $field->{type} eq 'Local' )
? 'Local'
: 'Set' )
. ' '
. $name . ' = '
. $value . "\n";
}
Expand Down Expand Up @@ -500,7 +503,7 @@ sub _parsePreferenceValue {

sub _action_restoreRevision {
my ($session) = @_;
my $query = $session->{request};
my $query = $session->{request};
my ( $web, $topic ) =
$session->normalizeWebTopicName( $session->{webName},
$session->{topicName} );
Expand All @@ -521,49 +524,49 @@ sub _action_restoreRevision {
}

# read the old topic
my $rev = $query->param('rev');
my $rev = $query->param('rev');
my $requestedRev = Foswiki::Store::cleanUpRevID( $query->param('rev') );

unless ($requestedRev) {
throw Foswiki::OopsException(
'attention',
def => 'restore_invalid_rev',
params => [$rev, $meta->getLoadedRev()]
params => [ $rev, $meta->getLoadedRev() ]
);
}

my $oldmeta = Foswiki::Meta->load( $session, $web, $topic, $requestedRev );

#print STDERR "REVS (".$meta->getLoadedRev().") (".$oldmeta->getLoadedRev().") ($requestedRev) \n";
#print STDERR "REVS (".$meta->getLoadedRev().") (".$oldmeta->getLoadedRev().") ($requestedRev) \n";

if ( ! defined $oldmeta->getLoadedRev()
|| $meta->getLoadedRev() == $oldmeta->getLoadedRev()
|| $oldmeta->getLoadedRev() != $rev
) {
if ( !defined $oldmeta->getLoadedRev()
|| $meta->getLoadedRev() == $oldmeta->getLoadedRev()
|| $oldmeta->getLoadedRev() != $rev )
{
throw Foswiki::OopsException(
'attention',
def => 'restore_invalid_rev',
params => [$rev, $meta->getLoadedRev()]
params => [ $rev, $meta->getLoadedRev() ]
);
}

foreach my $k (sort keys %$meta ) {
foreach my $k ( sort keys %$meta ) {
next if $k =~ m/^_/;
next if $k eq 'TOPICINFO'; # Don't revert topicinfo
next if $k eq 'FILEATTACHMENT'; # Don't revert attachments
$meta->remove($k) unless $oldmeta->{$k};
}
next if $k eq 'TOPICINFO'; # Don't revert topicinfo
next if $k eq 'FILEATTACHMENT'; # Don't revert attachments
$meta->remove($k) unless $oldmeta->{$k};
}

foreach my $k (sort keys %$oldmeta ) {
foreach my $k ( sort keys %$oldmeta ) {
next if $k =~ m/^_/;
next if $k eq 'TOPICINFO'; # Don't revert topicinfo
next if $k eq 'FILEATTACHMENT'; # Don't revert attachments
next if $k eq 'TOPICINFO'; # Don't revert topicinfo
next if $k eq 'FILEATTACHMENT'; # Don't revert attachments
$meta->copyFrom( $oldmeta, $k );
}
}

$meta->text($oldmeta->text()); # copy the old text
$meta->text( $oldmeta->text() ); # copy the old text

$meta->save(( forcenewrevision => 1 ) );
$meta->save( ( forcenewrevision => 1 ) );

$session->{cgiQuery}->delete('action');

Expand Down

0 comments on commit 5db15bd

Please sign in to comment.