Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8c92c352

Von Tamino Steinert vor 9 Monaten hinzugefügt

  • ID 8c92c35293c50a3808d3ad8ffd630fcd9c0bbccd
  • Vorgänger 11f62590
  • Nachfolger 19727dec

SL::File: Versionsnummber über file_version bestimmen

Unterschiede anzeigen:

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