Revision 10095677
Von Tamino Steinert vor 8 Monaten hinzugefügt
- ID 100956770fecfaba2bfd040d9f3ddf3e904c8e60
- Vorgänger 11f62590
SL/File.pm | ||
---|---|---|
72 | 72 |
@fileobjs = $self->get_all(%params); |
73 | 73 |
} |
74 | 74 |
foreach my $fileobj (@fileobjs) { |
75 |
$main::lxdebug->message(LXDebug->DEBUG2(), "obj=" . $fileobj . " id=" . $fileobj->id." versions=".$fileobj->version_count);
|
|
76 |
my $maxversion = $fileobj->version_count;
|
|
77 |
$fileobj->version($maxversion);
|
|
75 |
my @file_versions = reverse @{$fileobj->loaded_db_file->file_versions_sorted};
|
|
76 |
my $latest_file_version = shift @file_versions;
|
|
77 |
$fileobj->version($latest_file_version->version);
|
|
78 | 78 |
push @versionobjs, $fileobj; |
79 |
if ($maxversion > 1) { |
|
80 |
for my $version (2..$maxversion) { |
|
81 |
$main::lxdebug->message(LXDebug->DEBUG2(), "clone for version=".($maxversion-$version+1)); |
|
82 |
eval { |
|
83 |
my $clone = $fileobj->clone; |
|
84 |
$clone->version($maxversion-$version+1); |
|
85 |
$clone->newest(0); |
|
86 |
$main::lxdebug->message(LXDebug->DEBUG2(), "clone version=".$clone->version." mtime=". $clone->mtime); |
|
87 |
push @versionobjs, $clone; |
|
88 |
1; |
|
89 |
} or do {$::lxdebug->message(LXDebug::WARN(), "clone for version=".($maxversion-$version+1) . "failed: " . $@)}; |
|
90 |
} |
|
79 |
foreach my $file_version (@file_versions) { |
|
80 |
my $clone = $fileobj->clone; |
|
81 |
$clone->version($file_version->version); |
|
82 |
$clone->newest(0); |
|
83 |
push @versionobjs, $clone; |
|
91 | 84 |
} |
92 | 85 |
} |
93 | 86 |
return @versionobjs; |
Auch abrufbar als: Unified diff
SL::File: Versionsnummber über file_version bestimmen