Skip to content

Commit

Permalink
Item11088: perltidy
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@12859 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Oct 24, 2011
1 parent 2c2e5fe commit f5ed92d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Meta.pm
Expand Up @@ -1433,7 +1433,7 @@ sub setRevisionInfo {
# compatibility; older versions of the code use
# RCS rev numbers. Save with them so old code can
# read these topics
ASSERT(defined $ti->{version}) if DEBUG;
ASSERT( defined $ti->{version} ) if DEBUG;
$ti->{version} = 1 if $ti->{version} < 1;
$ti->{version} = $ti->{version};
$ti->{format} = $EMBEDDING_FORMAT_VERSION;
Expand Down
8 changes: 4 additions & 4 deletions core/lib/Foswiki/Store.pm
Expand Up @@ -180,7 +180,7 @@ sub askListeners {

foreach my $el ( @{ $this->{event_listeners} } ) {
next unless $el->can('loadTopic');
( $gotRev, $isLatest ) = $el->loadTopic($meta, $version);
( $gotRev, $isLatest ) = $el->loadTopic( $meta, $version );
return ( $gotRev, $isLatest ) if $gotRev;
}
return ( undef, undef );
Expand All @@ -200,11 +200,11 @@ will not be asked.

sub askListenersRevisionHistory {
my ( $this, $meta, $attachment ) = @_;
my ( $itr );
my ($itr);

foreach my $el ( @{ $this->{event_listeners} } ) {
next unless $el->can('getRevisionHistory');
return $itr = $el->getRevisionHistory($meta, $attachment);
return $itr = $el->getRevisionHistory( $meta, $attachment );
}
return undef;
}
Expand All @@ -224,7 +224,7 @@ sub askListenersVersionInfo {

foreach my $el ( @{ $this->{event_listeners} } ) {
next unless $el->can('getVersionInfo');
return $el->getVersionInfo($meta, $version, $attachment);
return $el->getVersionInfo( $meta, $version, $attachment );
}
return undef;
}
Expand Down
38 changes: 20 additions & 18 deletions core/lib/Foswiki/Store/VC/Store.pm
Expand Up @@ -79,9 +79,9 @@ sub getHandler {
sub readTopic {
my ( $this, $topicObject, $version ) = @_;

my ( $gotRev, $isLatest ) = $this->askListeners($topicObject, $version);
my ( $gotRev, $isLatest ) = $this->askListeners( $topicObject, $version );

if ( defined($gotRev) and ( $gotRev > 0 or ($isLatest)) ) {
if ( defined($gotRev) and ( $gotRev > 0 or ($isLatest) ) ) {
return ( $gotRev, $isLatest );
}
ASSERT( not $isLatest ) if DEBUG;
Expand All @@ -90,13 +90,14 @@ sub readTopic {
$isLatest = 0;

# check that the requested revision actually exists
if ( defined $version && $version =~ /^\d+$/) {
if ( defined $version && $version =~ /^\d+$/ ) {
if ( $version == 0 || !$handler->revisionExists($version) ) {
$version = $handler->getLatestRevisionID();
}
} else {
undef $version; # if it's a non-numeric string, we need to return undef
# "...$version is defined but refers to a version that does not exist, then $rev is undef"
}
else {
undef $version; # if it's a non-numeric string, we need to return undef
# "...$version is defined but refers to a version that does not exist, then $rev is undef"
}

( my $text, $isLatest ) = $handler->getRevision($version);
Expand All @@ -108,21 +109,22 @@ sub readTopic {
$text =~ s/\r//g; # Remove carriage returns
$topicObject->setEmbeddedStoreForm($text);

unless ($handler->noCheckinPending()) {
# If a checkin is pending, fix the TOPICINFO
my $ri = $topicObject->get('TOPICINFO');
my $truth = $handler->getInfo($version);
for my $i qw(author version date) {
$ri->{$i} = $truth->{$i};
}
unless ( $handler->noCheckinPending() ) {

# If a checkin is pending, fix the TOPICINFO
my $ri = $topicObject->get('TOPICINFO');
my $truth = $handler->getInfo($version);
for my $i qw(author version date) {
$ri->{$i} = $truth->{$i};
}
}

$gotRev = $version;
unless ( defined $gotRev ) {

# First try the just-loaded for the revision.
my $ri = $topicObject->get('TOPICINFO');
$gotRev = $ri->{version} if defined $ri;
$gotRev = $ri->{version} if defined $ri;
}
if ( !defined $gotRev ) {

Expand Down Expand Up @@ -277,7 +279,7 @@ sub openAttachment {
sub getRevisionHistory {
my ( $this, $topicObject, $attachment ) = @_;

my $itr = $this->askListenersRevisionHistory($topicObject, $attachment);
my $itr = $this->askListenersRevisionHistory( $topicObject, $attachment );

if ( defined($itr) ) {
return $itr;
Expand Down Expand Up @@ -312,7 +314,7 @@ sub getVersionInfo {
my ( $this, $topicObject ) = @_;
my $info = $this->askListenersVersionInfo($topicObject);

if (not defined $info) {
if ( not defined $info ) {
my $handler = $this->getHandler($topicObject);

$info = $handler->getInfo( $topicObject->getLoadedRev() );
Expand Down Expand Up @@ -348,9 +350,9 @@ sub saveTopic {

# just in case they are not sequential
my $nextRev = $handler->getNextRevisionID();
my $ti = $topicObject->get('TOPICINFO');
my $ti = $topicObject->get('TOPICINFO');
$ti->{version} = $nextRev;
$ti->{author} = $cUID;
$ti->{author} = $cUID;

$handler->addRevisionFromText( $topicObject->getEmbeddedStoreForm(),
'save topic', $cUID, $options->{forcedate} );
Expand Down

0 comments on commit f5ed92d

Please sign in to comment.