Here's a cleaned up version of the patch with the extraneous formatting
changes removed. Also included are two fixes for the user and email lookup.
69a70,71
> sub is_version_up_to_2_22 {
> my $self = shift;
70a73,78
> if ( $self->{version_type} eq "up_to_2_22" ) {
> return 1;
> } else {
> return 0;
> }
> }
108,114c116,127
<
<
< # This is the Bugzilla API file.
< my $package_name = "globals.pl";
< if ( package_exists( $package_name ) == 0) {
< return ( 2, "Package '" . $package_name . "' not found in installation
directory '" .
< $self->installation_directory() . "'.\n" );
---
> if ( $self->is_version_latest() ) {
> $package_name = "Bugzilla";
> if ( package_exists($package_name) == 0 ) {
> return ( 3, "Package '" . $package_name . "' not found in
> installation directory '" .
> $self->installation_directory() . "'.\n" );
> }
> } else {
> # This is the Bugzilla API file.
> $package_name = "globals.pl";
> if ( package_exists( $package_name ) == 0) {
> return ( 2, "Package '" . $package_name . "' not found in
> installation directory '" .
> $self->installation_directory() . "'.\n" );
116a130
> }
129c143
< if ( $self->is_version_up_to_2_20() || $self->is_version_latest() ) {
---
> if ( $self->is_version_up_to_2_20() || $self->is_version_up_to_2_22() ||
> $self->is_version_latest() ) {
144a159,171
> if ( $self->is_version_latest() ) {
> $package_name = "Bugzilla::Product";
> if ( package_exists($package_name) == 0 ) {
> return ( 3, "Package '" . $package_name . "' not found in
> installation directory '" .
> $self->installation_directory() . "'.\n" );
> }
>
> $package_name = "Bugzilla::Version";
> if ( package_exists($package_name) == 0 ) {
> return ( 3, "Package '" . $package_name . "' not found in
> installation directory '" .
> $self->installation_directory() . "'.\n" );
> }
> }
162,168c189,199
< # If Bugzilla is installed locally to the same machine the daemon
< # is installed, we can do more
< if ( $self->installed_locally() ) {
< # Force Bugzilla to regenerate the version cache file. In this
< # way, the version changes as a result of tagging are
< # reflected in the web interface immediately.
< GenerateVersionTable();
---
> if ( $self->is_version_latest() ) {
> # obsolete?
> } else {
> # If Bugzilla is installed locally to the same machine the daemon
> # is installed, we can do more
> if ( $self->installed_locally() ) {
> # Force Bugzilla to regenerate the version cache file. In this
> # way, the version changes as a result of tagging are
> # reflected in the web interface immediately.
> GenerateVersionTable();
> }
233c264
< $self->{ version_type } = $BUGTRACKER_VERSION_LATEST;
---
> $self->{version_type} = "up_to_2_22";
236a268,269
> } elsif ( $major == 3 && $minor == 0 ) {
> $self->{version_type} = $BUGTRACKER_VERSION_LATEST;
301c334
< } elsif ( $self->is_version_latest() ) {
---
> } elsif ( $self->is_version_up_to_2_22() || $self->is_version_latest() ) {
329a363,368
>
> if ( $self->is_version_latest() ) {
> my $bug = new Bugzilla::Bug($bugid);
> return $bug->product();
> }
>
335c374
< } elsif ( $self->is_version_up_to_2_18() ||
$self->is_version_up_to_2_20() || $self->is_version_latest() ) {
---
> } elsif ( $self->is_version_up_to_2_18() ||
> $self->is_version_up_to_2_20() || $self->is_version_up_to_2_22() ) {
356a396,401
>
> if ( $self->is_version_latest() ) {
> my $bug = new Bugzilla::Bug($bugid);
> return $bug->assigned_to()->login();
> }
>
376a422,427
>
> if ( $self->is_version_latest() ) {
> my $bug = new Bugzilla::Bug($bugid);
> return $bug->assigned_to()->email();
> }
>
410a462,478
>
> if ( $self->is_version_latest() ) {
> my @bug_monitors_email_list;
>
> my $bug = new Bugzilla::Bug($bugid);
> my (@cc) = $bug->cc();
> if (@cc) {
> foreach my $c (@cc) {
> foreach my $bug_monitor_email (@$c) {
> push @bug_monitors_email_list, $bug_monitor_email;
> }
> }
> }
>
> return @bug_monitors_email_list;
> }
>
451a520,525
>
> if ( $self->is_version_latest() ) {
> my $bug = new Bugzilla::Bug($bugid);
> return $bug->bug_status();
> }
>
504a579,584
>
> if ( $self->is_version_latest() ) {
> my $bug = new Bugzilla::Bug($bugid);
> return $bug->short_desc();
> }
>
526a607,613
>
> if ( $self->is_version_latest() ) {
> my $product = new Bugzilla::Product( { name => $product_name } );
> my $version = Bugzilla::Version::create( $tag_name, $product );
> return 0;
> }
>
537c624
< } elsif ( $self->is_version_up_to_2_18() ||
$self->is_version_up_to_2_20() || $self->is_version_latest() ) {
---
> } elsif ( $self->is_version_up_to_2_18() ||
> $self->is_version_up_to_2_20() || $self->is_version_up_to_2_22() ) {
546c633
<
---
>
569a657,670
>
> if ( $self->is_version_latest() ) {
> my $product = new Bugzilla::Product( { name => $product_name } );
> my $versions = $product->versions();
> if ($versions) {
> foreach (@$versions) {
> if ( $_->name eq $tag_name ) {
> return 1;
> }
> }
> }
> return 0;
> }
>
578c679
< } elsif ( $self->is_version_up_to_2_18() ||
$self->is_version_up_to_2_20() || $self->is_version_latest() ) {
---
> } elsif ( $self->is_version_up_to_2_18() ||
> $self->is_version_up_to_2_20() || $self->is_version_up_to_2_22() ) {
592c693
<
---
>
612a714,721
>
> if ( $self->is_version_latest() ) {
> my $product = new Bugzilla::Product( { name => $product_name } );
> my $version = new Bugzilla::Version( $product->id, $tag_name );
> $version->remove_from_db;
> return 0;
> }
>
618c727
< } elsif ( $self->is_version_up_to_2_18() ||
$self->is_version_up_to_2_20() || $self->is_version_latest() ) {
---
> } elsif ( $self->is_version_up_to_2_18() ||
> $self->is_version_up_to_2_20() || $self->is_version_up_to_2_22() ) {
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users