Working with a project "og_subgroups", which has a 6.0-0.x-dev and a 6.0-1.x-dev release, the 6.x-0.x releasenotes are displayed even when the 6.0-1.x-dev release is installed. Wrong release notes are shown for pm-updatecode and pm-releasenotes. Correct release notes are shown in pm-releasenotes when version is explicitly provided.

$ drush @genidev pm-updatecode
Update information last refreshed: Mon, 11/22/2010 - 17:19

Update status information on all installed and enabled Drupal projects:
 Name                             Installed       Proposed        Status        
                                  version         version                       
 Subgroups for Organic groups     6.x-1.x-dev     6.x-1.x-dev     Update        
                                                                  available     
 

Code updates will be made to the following projects:
Subgroups for Organic groups [og_subgroups-6.x-1.x-dev]
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-0.x-dev:
 > Last updated: July 11, 2010 - 07:58.
 > Note: this is the recommended version.
------------------------------------------------------------------------------
Nightly development snapshot for Drupal 6.




Note: Updated projects can potentially break your site. It is NOT recommended to update production sites without prior testing.
Note: A backup of your package will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): n
drush: Aborting.
ga@ubuntu:~$ drush @genidev pm-releases og_subgroups
------- RELEASES FOR 'OG_SUBGROUPS' PROJECT -------
 Release         Date         Status                              
 6.x-1.x-dev     2010-Nov-18  Supported, Development, Installed   
 6.x-0.x-dev     2010-Jul-11  Supported, Recommended, Development 

ga@ubuntu:~$ drush @genidev pm-releasenotes og_subgroups
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-0.x-dev:
 > Last updated: July 11, 2010 - 07:58.
 > Note: this is the recommended version.
------------------------------------------------------------------------------
Nightly development snapshot for Drupal 6.



ga@ubuntu:~$ drush @genidev pm-releasenotes og_subgroups-6.x-0.x-dev
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-0.x-dev:
 > Last updated: July 11, 2010 - 07:58.
 > Note: this is the recommended version.
------------------------------------------------------------------------------
Nightly development snapshot for Drupal 6.



ga@ubuntu:~$ drush @genidev pm-releasenotes og_subgroups-6.x-1.x-dev
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-1.x-dev:
 > Last updated: November 18, 2010 - 18:46.
 > Note: this is the installed version.
------------------------------------------------------------------------------
This is a new branch that stemmed from a direct port of the 5.x-4.0 branch.  
This branch will not have a dependency on the Book module. See #337808:  
Eliminate dependence on book.module

Comments

greg.1.anderson’s picture

I realize now that in the case above, 6.x-0.x-dev is the recommended release, so this is just another case of #760814: drush pm-update offers to update to an older release than currently installed, and misses the newest available release, but for pm-releasenotes.

jonhattan’s picture

Code related to this starts in pm.drush.inc:1074. That code needs some clarification.

luchochs’s picture

Status: Needs review » Active

In short, if the project does not have a recommended release with same version_major that the installed one, then only shows the release notes for the recommended one. Not so unwanted, I think.

Update: I write it as if it were a telegram, my apologies. More specific queries on the code would help me to respond faster. Well, a little less slow.

luchochs’s picture

Status: Active » Needs work
StatusFileSize
new860 bytes

This patch may help to keep consistency in the output.

luchochs’s picture

Status: Needs work » Needs review

Sorry.

greg.1.anderson’s picture

Status: Active » Needs review

I didn't have a chance to test the patch in #4 yet, but I suspect that what is going to be needed is a date-based check as in the issue quoted in #1. Leaving as "needs review" until I confirm my suspicion, but I suspect this needs work.

luchochs’s picture

Suspicions welcome.

greg.1.anderson’s picture

Status: Needs review » Needs work

Still not quite right. Take for example the situation where the recommended release of captcha is installed:

$ drush @wkdev pm-releasenotes captcha
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'CAPTCHA' PROJECT, VERSION 6.x-2.3:
 > Last updated: November 9, 2010 - 23:55.
 > Note: this is the installed & recommended version.
------------------------------------------------------------------------------

This is correct. Now let's move forward to the latest dev release on the 2.x line:

$ drush @wkdev dl captcha-6.x-2.x-dev
$ drush @wkdev pm-releasenotes captcha
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'CAPTCHA' PROJECT, VERSION 6.x-2.x-dev:
 > Last updated: November 17, 2010 - 00:07.
 > Note: this is the installed version.
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'CAPTCHA' PROJECT, VERSION 6.x-2.0-beta1:
 > Last updated: January 3, 2009 - 22:30.
 > Note: the installed version is 6.x-2.x-dev.
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'CAPTCHA' PROJECT, VERSION 6.x-2.0-beta2:
 > Last updated: February 2, 2009 - 19:50.
 > Note: the installed version is 6.x-2.x-dev.
------------------------------------------------------------------------------
 > RELEASE NOTES FOR 'CAPTCHA' PROJECT, VERSION 6.x-2.0-beta3:
 > Last updated: April 7, 2009 - 01:00.--More--
 > Note: the installed version is 6.x-2.x-dev.
------------------------------------------------------------------------------

etc.

The code is assuming that any "beta" or "stable" release is newer than the installed "dev" release, even though 2.x-dev was released more recently than 2.0-beta1 (since 2.x-dev is more recent than 2.3 stable, and therefore represents development that will eventually lead to a 2.4 release).

The code will need to be adjusted to include date comparison of the releases version when deciding which release notes to display.

luchochs’s picture

Title: pm-releasenotes does not always select the correct releasenotes when version not explicitly provided » pm-releasenotes does not select the correct releasenotes when version not explicitly provided and 'dev' is the installed one
luchochs’s picture

In a nutshell: date-based check rules.

luchochs’s picture

Status: Needs work » Needs review
StatusFileSize
new2.7 KB

(#10's complement.)
Simpler, more effective; better.

greg.1.anderson’s picture

Have not tested yet, but code looks good.

greg.1.anderson’s picture

Status: Needs review » Reviewed & tested by the community

Works great.

jonhattan’s picture

Component: Core Commands » PM (dl, en, up ...)
Status: Reviewed & tested by the community » Fixed

That's great. I got lost in the previous $i++ approach.

Commited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.