I ran into some issues upgrading CTools and Panels together recently, and found that drush did not obtain the new stylizer subproject from CTools during the update. A separate cvs update -dP was required in the CTools directory to obtain the new folder and files.

The command drush executes is as follows:
cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib update -r DRUPAL-6--3-7 panels

All the examples I've seen of cvs commands place the -dP flags after update, though they also don't use the repository login and path information as well.

Not sure if this is the correct approach, as I am very unfamiliar with cvs, but the included patch changes the order of the $cvsparts array so that the flags appear later in the command. I'll report on any successes or issues with the patch later.

Comments

greg.1.anderson’s picture

Component: Code » PM (dl, en, up ...)
Priority: Normal » Major
Status: Needs review » Needs work

I committed this, but then backed it out when I realized that this also moves the cvsparams after cvs checkout, and cvsparams are -dP for both checkout and update. -P is prune for both update and checkout, but -d is 'build directories' for update, and it is 'check out into dir' for checkout.

This bug existed in drush prior to this patch, but since the cvsparms were not placed in the correct location, it did not break checkout. More work is needed here; it's broken.

greg.1.anderson’s picture

Priority: Major » Normal

I guess this isn't 'major', since it seems to mostly work, despite the fact that the command is incorrectly formed.

gapple’s picture

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

It seems then that none of the flags are actually necessary when checking out, though let me know if this assumption is incorrect.

The following patch will only apply flags when updating, specifying -dPC for folders not under subversion control, and -dP for those that are.

It is completely untested, but I hope this patch is the right idea.

jonhattan’s picture

Assigned: Unassigned » jonhattan
Status: Needs review » Needs work

I'll document my way to understanding.

checkout

drush does:

cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-6--1-0 -d ctools contributions/modules/ctools

Doc in ctools's cvs instructions tab:

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d ctools-DRUPAL-6--1 -r DRUPAL-6--1 contributions/modules/ctools/

update

drush with no other vcs (svn):

Calling chdir(/var/www/drupal-6.15/sites/all/modules)
Executing: cvs -z6 -dPC -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib update -r DRUPAL-6--1-7 ctools

if .svn is detected it changes -dPC to -dP.

Doc in ctools's cvs instructions tab:

cvs update -dPr DRUPAL-6--1

----

This is what cvs command wants:

Usage: cvs [cvs-options] command [command-options-and-arguments]

-dPC means nothing for cvs-options (that are global for any command). Both checkout and update are fine with cvs-options: -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib

-d:pserver... is not needed for update but doesn't hurt and perhaps is useful in some cases where --cvscredentials is provided.

so -dP or -dPC are command options for update, along with -r for the cvs tag.

In summary we need this:

checkout:

cvs -z6 -d:pserver... checkout -r {TAG} -d {MODULE} contributions/modules/{MODULE}

update:

cvs -z6 -d:pserver... update -dP(C) -r {TAG} {MODULE}

Lastly, option names are not precise: --cvsparams should change to --cvs-global-options or --cvs-command-options, whatever is wanted.
I have no idea on the need to pass custom params (command or global). Perhaps someone using --cvsparams can put some clues here... there's no other issue in the queue naming cvsparams but this one :/. Perhaps it's just useless.

I'll commit a rework of the involved funcion to solve it.

jonhattan’s picture

Status: Needs work » Fixed

Commited. http://drupal.org/cvs?commit=435662

Note this related bug: #940688: updatecode: --version-control=backup stop updatecode --package-handler=cvs to use cvs update and force always a checkout.

Commited code has a non-satisfactory implementation of --cvsparams but I first need to know what is this for: global? command specific? are intended to completely override drush defaults or to be append? Will open other issue for this.

Status: Fixed » Closed (fixed)

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